]> git.tdb.fi Git - libs/gl.git/blob - source/animation/animatedobject.h
Rearrange soucre files into subdirectories
[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         ~AnimatedObject();
39
40         void set_pose_matrix(unsigned, const Matrix &);
41         ProgramData &get_shader_data();
42         const ProgramData &get_shader_data() const;
43
44         DEPRECATED 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