1 #ifndef MSP_GL_KEYFRAME_H_
2 #define MSP_GL_KEYFRAME_H_
4 #include <msp/core/refptr.h>
5 #include <msp/datafile/objectloader.h>
14 Keyframes are used to encapsulate object state for animation.
19 class Loader: public DataFile::CollectionObjectLoader<KeyFrame>
23 Loader(KeyFrame &, Collection &);
27 void pose(const std::string &);
29 void position(float, float, float);
30 void rotation(float, float, float, float);
31 void scaling_uniform(float);
32 void scaling(float, float, float);
36 class UniformsLoader: public DataFile::ObjectLoader<KeyFrame>
39 UniformsLoader(KeyFrame &);
42 void uniform1f(const std::string &, float);
43 void uniform2f(const std::string &, float, float);
44 void uniform3f(const std::string &, float, float, float);
45 void uniform4f(const std::string &, float, float, float, float);
48 struct AnimatedUniform
53 AnimatedUniform(unsigned, float, float = 0.0f, float = 0.0f, float = 0.0f);
56 typedef std::map<std::string, AnimatedUniform> UniformMap;
61 RefPtr<const Pose> pose;
67 void set_matrix(const Matrix &);
68 void set_pose(const Pose &);
69 const Matrix &get_matrix() const { return matrix; }
70 const UniformMap &get_uniforms() const { return uniforms; }
71 const Pose *get_pose() const { return pose.get(); }