X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fkeyframe.cpp;h=708fa22bc338e25a478ec11ccc969eccccf37589;hp=dd4adf16611efb7c2c05312d0428d949de7c6df5;hb=9e384cddaf641f25ce6714327e1b4fadfea4632d;hpb=8ed377139d48a6fc39eeed9f3494bbe41aed4107 diff --git a/source/keyframe.cpp b/source/keyframe.cpp index dd4adf16..708fa22b 100644 --- a/source/keyframe.cpp +++ b/source/keyframe.cpp @@ -1,6 +1,7 @@ #include #include "keyframe.h" #include "pose.h" +#include "transform.h" using namespace std; @@ -52,11 +53,14 @@ void KeyFrame::Loader::init() { add("pose", &Loader::pose); add("pose", &Loader::pose_inline); + add("transform", &Loader::transform); + add("uniforms", &Loader::uniforms); + + // Deprecated; use the transform statement instead add("position", &Loader::position); add("rotation", &Loader::rotation); add("scaling", &Loader::scaling_uniform); add("scaling", &Loader::scaling); - add("uniforms", &Loader::uniforms); } void KeyFrame::Loader::pose(const string &n) @@ -92,6 +96,13 @@ void KeyFrame::Loader::scaling(float x, float y, float z) obj.matrix.scale(x, y, z); } +void KeyFrame::Loader::transform() +{ + Transform trn; + load_sub(trn); + obj.matrix = trn.to_matrix(); +} + void KeyFrame::Loader::uniforms() { UniformsLoader ldr(obj);