X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fanimatedobject.h;h=73c39e2ca8b2a240e5647ef6d8b6ae02914a0609;hp=acec4322af1d08ee15c755fe1cdea9368c9af41e;hb=9e384cddaf641f25ce6714327e1b4fadfea4632d;hpb=57fc4142e0b19a21f61c60b00f8310d5d2c27871 diff --git a/source/animatedobject.h b/source/animatedobject.h index acec4322..73c39e2c 100644 --- a/source/animatedobject.h +++ b/source/animatedobject.h @@ -1,6 +1,9 @@ #ifndef MSP_GL_ANIMATEDOBJECT_H_ #define MSP_GL_ANIMATEDOBJECT_H_ +#include +#include +#include "keyframe.h" #include "matrix.h" #include "objectinstance.h" @@ -8,20 +11,40 @@ 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 + { + public: + Loader(AnimatedObject &); + + private: + void position(float, float, float); + void rotation(float, float, float, float); + void scale(float, float, float); + void scale_uniform(float); + void transform(); + }; + private: - Matrix matrix; + std::vector pose_data; ProgramData *shdata; 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; } virtual void setup_render(Renderer &, const Tag &) const; };