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