]> git.tdb.fi Git - libs/gl.git/blob - source/animatedobject.h
Visit the rest of an iteration statement in NodeRemover
[libs/gl.git] / source / animatedobject.h
1 #ifndef MSP_GL_ANIMATEDOBJECT_H_
2 #define MSP_GL_ANIMATEDOBJECT_H_
3
4 #include <vector>
5 #include <msp/datafile/objectloader.h>
6 #include "keyframe.h"
7 #include "matrix.h"
8 #include "objectinstance.h"
9
10 namespace Msp {
11 namespace GL {
12
13 /**
14 An object instance that can be animated by an AnimationPlayer.
15 */
16 class AnimatedObject: public ObjectInstance
17 {
18 public:
19         class Loader: public DataFile::ObjectLoader<AnimatedObject>
20         {
21         public:
22                 Loader(AnimatedObject &);
23
24         private:
25                 void position(float, float, float);
26                 void rotation(float, float, float, float);
27                 void scale(float, float, float);
28                 void scale_uniform(float);
29         };
30
31 private:
32         std::vector<float> pose_data;
33         ProgramData *shdata;
34
35 public:
36         AnimatedObject(const Object &);
37         ~AnimatedObject();
38
39         void set_pose_matrix(unsigned, const Matrix &);
40         ProgramData &get_shader_data();
41         const ProgramData &get_shader_data() const;
42
43         // Deprecated
44         void set_uniform(const std::string &, const KeyFrame::AnimatedUniform &);
45
46         virtual const Matrix *get_matrix() const { return &matrix; }
47
48         virtual void setup_render(Renderer &, const Tag &) const;
49 };
50
51 } // namespace GL
52 } // namespace Msp
53
54 #endif