]> git.tdb.fi Git - libs/gl.git/blob - source/keyframe.h
Allow setting keyframe matrix from the outside
[libs/gl.git] / source / keyframe.h
1 #ifndef MSP_GL_KEYFRAME_H_
2 #define MSP_GL_KEYFRAME_H_
3
4 #include <msp/datafile/objectloader.h>
5 #include "matrix.h"
6
7 namespace Msp {
8 namespace GL {
9
10 /**
11 Keyframes are used to encapsulate object state for animation.
12 */
13 class KeyFrame
14 {
15 public:
16         class Loader: public DataFile::ObjectLoader<KeyFrame>
17         {
18         public:
19                 Loader(KeyFrame &);
20         private:
21                 void position(float, float, float);
22                 void rotation(float, float, float, float);
23                 void scaling_uniform(float);
24                 void scaling(float, float, float);
25         };
26
27 private:
28         Matrix matrix;
29
30 public:
31         void set_matrix(const Matrix &);
32         const Matrix &get_matrix() const { return matrix; }
33 };
34
35 } // namespace GL
36 } // namespace Msp
37
38 #endif