X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fkeyframe.cpp;h=8eba17292368a33b576a0ae0186ee9388aacaa6b;hp=708fa22bc338e25a478ec11ccc969eccccf37589;hb=a4549c55a6d47129bd9e42c6a49a671b759ce6d9;hpb=aea9ceca71b59358248be94fdf272fd4791ca990 diff --git a/source/keyframe.cpp b/source/keyframe.cpp index 708fa22b..8eba1729 100644 --- a/source/keyframe.cpp +++ b/source/keyframe.cpp @@ -1,7 +1,6 @@ #include #include "keyframe.h" #include "pose.h" -#include "transform.h" using namespace std; @@ -15,9 +14,14 @@ KeyFrame::KeyFrame() KeyFrame::~KeyFrame() { } +void KeyFrame::set_transform(const Transform &t) +{ + transform = t; +} + void KeyFrame::set_matrix(const Matrix &m) { - matrix = m; + transform = Transform::from_matrix(m); } void KeyFrame::set_pose(const Pose &p) @@ -78,29 +82,27 @@ void KeyFrame::Loader::pose_inline() void KeyFrame::Loader::position(float x, float y, float z) { - obj.matrix.translate(x, y, z); + obj.transform.set_position(Vector3(x, y, z)); } void KeyFrame::Loader::rotation(float a, float x, float y, float z) { - obj.matrix.rotate_deg(a, x, y, z); + obj.transform.set_rotation(Transform::Angle::from_degrees(a), Vector3(x, y, z)); } void KeyFrame::Loader::scaling_uniform(float s) { - obj.matrix.scale(s); + obj.transform.set_scale(s); } void KeyFrame::Loader::scaling(float x, float y, float z) { - obj.matrix.scale(x, y, z); + obj.transform.set_scale(Vector3(x, y, z)); } void KeyFrame::Loader::transform() { - Transform trn; - load_sub(trn); - obj.matrix = trn.to_matrix(); + load_sub(obj.transform); } void KeyFrame::Loader::uniforms()