]> git.tdb.fi Git - libs/gl.git/blob - source/keyframe.cpp
Basic animation support
[libs/gl.git] / source / keyframe.cpp
1 #include "keyframe.h"
2
3 namespace Msp {
4 namespace GL {
5
6 KeyFrame::Loader::Loader(KeyFrame &k):
7         DataFile::ObjectLoader<KeyFrame>(k)
8 {
9         add("position", &Loader::position);
10         add("rotation", &Loader::rotation);
11         add("scaling", &Loader::scaling_uniform);
12         add("scaling", &Loader::scaling);
13 }
14
15 void KeyFrame::Loader::position(float x, float y, float z)
16 {
17         obj.matrix.translate(x, y, z);
18 }
19
20 void KeyFrame::Loader::rotation(float a, float x, float y, float z)
21 {
22         obj.matrix.rotate_deg(a, x, y, z);
23 }
24
25 void KeyFrame::Loader::scaling_uniform(float s)
26 {
27         obj.matrix.scale(s);
28 }
29
30 void KeyFrame::Loader::scaling(float x, float y, float z)
31 {
32         obj.matrix.scale(x, y, z);
33 }
34
35 } // namespace GL
36 } // namespace Msp