]> git.tdb.fi Git - libs/gl.git/blobdiff - source/keyframe.h
Basic animation support
[libs/gl.git] / source / keyframe.h
diff --git a/source/keyframe.h b/source/keyframe.h
new file mode 100644 (file)
index 0000000..4b0fa5b
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef MSP_GL_KEYFRAME_H_
+#define MSP_GL_KEYFRAME_H_
+
+#include <msp/datafile/objectloader.h>
+#include "matrix.h"
+
+namespace Msp {
+namespace GL {
+
+/**
+Keyframes are used to encapsulate object state for animation.
+*/
+class KeyFrame
+{
+public:
+       class Loader: public DataFile::ObjectLoader<KeyFrame>
+       {
+       public:
+               Loader(KeyFrame &);
+       private:
+               void position(float, float, float);
+               void rotation(float, float, float, float);
+               void scaling_uniform(float);
+               void scaling(float, float, float);
+       };
+
+private:
+       Matrix matrix;
+
+public:
+       const Matrix &get_matrix() const { return matrix; }
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif