]> git.tdb.fi Git - libs/gl.git/blobdiff - source/animatedobject.h
Better naming algorithm for objects in scene export
[libs/gl.git] / source / animatedobject.h
index 6bcd37ce4b609dbecadece72bfc336bc75317827..74e59fc8a76071196baf10da16a3ab7598ab14bf 100644 (file)
@@ -2,6 +2,8 @@
 #define MSP_GL_ANIMATEDOBJECT_H_
 
 #include <vector>
+#include <msp/datafile/objectloader.h>
+#include "keyframe.h"
 #include "matrix.h"
 #include "objectinstance.h"
 
@@ -9,13 +11,24 @@ namespace Msp {
 namespace GL {
 
 /**
-An object instance that can be animated.  Despite the name, this can also be
-useful for displaying objects at a static position.
+An object instance that can be animated by an AnimationPlayer.
 */
 class AnimatedObject: public ObjectInstance
 {
+public:
+       class Loader: public DataFile::ObjectLoader<AnimatedObject>
+       {
+       public:
+               Loader(AnimatedObject &);
+
+       private:
+               void position(float, float, float);
+               void rotation(float, float, float, float);
+               void scale(float, float, float);
+               void scale_uniform(float);
+       };
+
 private:
-       Matrix matrix;
        std::vector<float> pose_data;
        ProgramData *shdata;
 
@@ -23,8 +36,12 @@ public:
        AnimatedObject(const Object &);
        ~AnimatedObject();
 
-       void set_matrix(const Matrix &);
        void set_pose_matrix(unsigned, const Matrix &);
+       ProgramData &get_shader_data();
+       const ProgramData &get_shader_data() const;
+
+       // Deprecated
+       void set_uniform(const std::string &, const KeyFrame::AnimatedUniform &);
 
        virtual const Matrix *get_matrix() const { return &matrix; }