1 #include <msp/datafile/collection.h>
10 void KeyFrame::set_matrix(const Matrix &m)
15 void KeyFrame::set_pose(const Pose &p)
22 KeyFrame::Loader::Loader(KeyFrame &k):
23 DataFile::CollectionObjectLoader<KeyFrame>(k, 0)
28 KeyFrame::Loader::Loader(KeyFrame &k, Collection &c):
29 DataFile::CollectionObjectLoader<KeyFrame>(k, &c)
34 void KeyFrame::Loader::init()
36 add("pose", &Loader::pose);
37 add("pose", &Loader::pose_inline);
38 add("position", &Loader::position);
39 add("rotation", &Loader::rotation);
40 add("scaling", &Loader::scaling_uniform);
41 add("scaling", &Loader::scaling);
44 void KeyFrame::Loader::pose(const string &n)
46 obj.pose = &get_collection().get<Pose>(n);
50 void KeyFrame::Loader::pose_inline()
52 RefPtr<Pose> p = new Pose;
53 load_sub(*p, get_collection());
57 void KeyFrame::Loader::position(float x, float y, float z)
59 obj.matrix.translate(x, y, z);
62 void KeyFrame::Loader::rotation(float a, float x, float y, float z)
64 obj.matrix.rotate_deg(a, x, y, z);
67 void KeyFrame::Loader::scaling_uniform(float s)
72 void KeyFrame::Loader::scaling(float x, float y, float z)
74 obj.matrix.scale(x, y, z);