X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fanimatedobject.h;h=2b640b763fa1859807f5a2a0736b44c57ca7aa87;hp=6bcd37ce4b609dbecadece72bfc336bc75317827;hb=a9c375e17065bcc429b430bd8211a9ee845159a5;hpb=f2592f0e67d92043952eb7a2e39df182720cd990 diff --git a/source/animatedobject.h b/source/animatedobject.h index 6bcd37ce..2b640b76 100644 --- a/source/animatedobject.h +++ b/source/animatedobject.h @@ -2,6 +2,8 @@ #define MSP_GL_ANIMATEDOBJECT_H_ #include +#include +#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::DerivedObjectLoader + { + 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 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; }