]> git.tdb.fi Git - libs/gl.git/blobdiff - source/keyframe.h
Support for armature-based animation
[libs/gl.git] / source / keyframe.h
index bc3d65ecbfa80fec692d21f326f4e016e2bd5df7..ccfbda9a4f0cdf3dd2107f7e60ed028dd77f0021 100644 (file)
@@ -1,23 +1,31 @@
 #ifndef MSP_GL_KEYFRAME_H_
 #define MSP_GL_KEYFRAME_H_
 
+#include <msp/core/refptr.h>
 #include <msp/datafile/objectloader.h>
 #include "matrix.h"
 
 namespace Msp {
 namespace GL {
 
+class Pose;
+
 /**
 Keyframes are used to encapsulate object state for animation.
 */
 class KeyFrame
 {
 public:
-       class Loader: public DataFile::ObjectLoader<KeyFrame>
+       class Loader: public DataFile::CollectionObjectLoader<KeyFrame>
        {
        public:
                Loader(KeyFrame &);
+               Loader(KeyFrame &, Collection &);
        private:
+               void init();
+
+               void pose(const std::string &);
+               void pose_inline();
                void position(float, float, float);
                void rotation(float, float, float, float);
                void scaling_uniform(float);
@@ -26,10 +34,13 @@ public:
 
 private:
        Matrix matrix;
+       RefPtr<const Pose> pose;
 
 public:
        void set_matrix(const Matrix &);
+       void set_pose(const Pose &);
        const Matrix &get_matrix() const { return matrix; }
+       const Pose *get_pose() const { return pose.get(); }
 };
 
 } // namespace GL