]> git.tdb.fi Git - libs/gl.git/blob - source/keyframe.h
Force some c'tors and d'tors to be emitted in the library
[libs/gl.git] / source / keyframe.h
1 #ifndef MSP_GL_KEYFRAME_H_
2 #define MSP_GL_KEYFRAME_H_
3
4 #include <msp/core/refptr.h>
5 #include <msp/datafile/objectloader.h>
6 #include "matrix.h"
7
8 namespace Msp {
9 namespace GL {
10
11 class Pose;
12
13 /**
14 Keyframes are used to encapsulate object state for animation.
15 */
16 class KeyFrame
17 {
18 public:
19         class Loader: public DataFile::CollectionObjectLoader<KeyFrame>
20         {
21         public:
22                 Loader(KeyFrame &);
23                 Loader(KeyFrame &, Collection &);
24         private:
25                 void init();
26
27                 void pose(const std::string &);
28                 void pose_inline();
29                 void position(float, float, float);
30                 void rotation(float, float, float, float);
31                 void scaling_uniform(float);
32                 void scaling(float, float, float);
33         };
34
35 private:
36         Matrix matrix;
37         RefPtr<const Pose> pose;
38
39 public:
40         KeyFrame();
41         ~KeyFrame();
42
43         void set_matrix(const Matrix &);
44         void set_pose(const Pose &);
45         const Matrix &get_matrix() const { return matrix; }
46         const Pose *get_pose() const { return pose.get(); }
47 };
48
49 } // namespace GL
50 } // namespace Msp
51
52 #endif