1 #include <msp/datafile/collection.h>
10 // Avoid synthesizing RefPtr c'tor and d'tor in files including keyframe.h
17 void KeyFrame::set_matrix(const Matrix &m)
22 void KeyFrame::set_pose(const Pose &p)
29 KeyFrame::Loader::Loader(KeyFrame &k):
30 DataFile::CollectionObjectLoader<KeyFrame>(k, 0)
35 KeyFrame::Loader::Loader(KeyFrame &k, Collection &c):
36 DataFile::CollectionObjectLoader<KeyFrame>(k, &c)
41 void KeyFrame::Loader::init()
43 add("pose", &Loader::pose);
44 add("pose", &Loader::pose_inline);
45 add("position", &Loader::position);
46 add("rotation", &Loader::rotation);
47 add("scaling", &Loader::scaling_uniform);
48 add("scaling", &Loader::scaling);
51 void KeyFrame::Loader::pose(const string &n)
53 obj.pose = &get_collection().get<Pose>(n);
57 void KeyFrame::Loader::pose_inline()
59 RefPtr<Pose> p = new Pose;
60 load_sub(*p, get_collection());
64 void KeyFrame::Loader::position(float x, float y, float z)
66 obj.matrix.translate(x, y, z);
69 void KeyFrame::Loader::rotation(float a, float x, float y, float z)
71 obj.matrix.rotate_deg(a, x, y, z);
74 void KeyFrame::Loader::scaling_uniform(float s)
79 void KeyFrame::Loader::scaling(float x, float y, float z)
81 obj.matrix.scale(x, y, z);