X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fanimation.cpp;h=c0b508180b0da9f8676cd12e6f5c74a4a77cede1;hb=2b779717e42b514210f7128cf9aee2276650e003;hp=8135cb5995a406e5f9b722f5ca242b3c60eecb96;hpb=cbe341d00829fd0eab8f3d4bde840ccae61be7e9;p=libs%2Fgl.git diff --git a/source/animation.cpp b/source/animation.cpp index 8135cb59..c0b50818 100644 --- a/source/animation.cpp +++ b/source/animation.cpp @@ -17,6 +17,10 @@ Animation::Animation(): looping(false) { } +// Avoid synthesizing ~RefPtr in files including animation.h +Animation::~Animation() +{ } + void Animation::set_armature(const Armature &a) { armature = &a; @@ -219,10 +223,11 @@ Matrix Animation::Iterator::get_pose_matrix(unsigned link) const } // We must redo the base point correction since interpolation throws if off + // XXX This should probably be done on local matrices Matrix result = iter->pose_matrices[link].get(time_since_keyframe/iter->delta_t); const Vector3 &base = animation.armature->get_link(link).get_base(); Vector3 new_base = result*base; - result = Matrix::translation(base.x-new_base.x, base.y-new_base.y, base.z-new_base.z)*result; + result = Matrix::translation(base-new_base)*result; return result; }