]> Dogcows Code - chaz/yoink/blob - src/Animation.hh
fixed documentation about where to find licenses
[chaz/yoink] / src / Animation.hh
1
2 /*] Copyright (c) 2009-2011, Charles McGarvey [*****************************
3 **] All rights reserved.
4 *
5 * Distributable under the terms and conditions of the 2-clause BSD license;
6 * see the file COPYING for a complete text of the license.
7 *
8 *****************************************************************************/
9
10 #ifndef _ANIMATION_HH_
11 #define _ANIMATION_HH_
12
13 #include <string>
14
15 #include <boost/shared_ptr.hpp>
16
17 #include <moof/math.hh>
18
19
20 /**
21 * \file Animation.hh
22 * Motion picture!!
23 */
24
25 class Animation;
26 typedef boost::shared_ptr<Animation> AnimationP;
27
28 /**
29 * A class to manage frame-based animation. Animation sequences can be
30 * loaded from file, then named sequences are started. The animation is
31 * updated periodically (each update cycle), and the correct current frame
32 * is determined. This class is generic enough that a frame can mean just
33 * about anything to whatever drawing context is used to render the frame.
34 */
35 class Animation
36 {
37 public:
38
39 Animation(const std::string& name);
40
41 static AnimationP alloc(const std::string& name)
42 {
43 return AnimationP(new Animation(name));
44 }
45
46 void startSequence(const std::string& name);
47
48 void update(moof::scalar t, moof::scalar dt);
49 unsigned getFrame() const;
50
51 private:
52
53 class impl;
54 boost::shared_ptr<impl> impl_;
55 };
56
57
58 #endif // _ANIMATION_HH_
59
This page took 0.037002 seconds and 4 git commands to generate.