]> git.tdb.fi Git - libs/gl.git/blobdiff - source/keyframe.h
Store a Transform in keyframes instead of a Matrix
[libs/gl.git] / source / keyframe.h
index 88e852149570cae1d6e32968a60d73ed9cd6a5b5..4b985ca7e56dfb0d5248132cd9ff7b17d287e9f2 100644 (file)
@@ -4,6 +4,7 @@
 #include <msp/core/refptr.h>
 #include <msp/datafile/objectloader.h>
 #include "matrix.h"
+#include "transform.h"
 
 namespace Msp {
 namespace GL {
@@ -57,7 +58,7 @@ public:
        typedef std::map<std::string, AnimatedUniform> UniformMap;
 
 private:
-       Matrix matrix;
+       Transform transform;
        UniformMap uniforms;
        RefPtr<const Pose> pose;
 
@@ -65,9 +66,11 @@ public:
        KeyFrame();
        ~KeyFrame();
 
+       void set_transform(const Transform &);
        void set_matrix(const Matrix &);
        void set_pose(const Pose &);
-       const Matrix &get_matrix() const { return matrix; }
+       const Transform &get_transform() const { return transform; }
+       Matrix get_matrix() const { return transform.to_matrix(); }
        const UniformMap &get_uniforms() const { return uniforms; }
        const Pose *get_pose() const { return pose.get(); }
 };