]> git.tdb.fi Git - libs/gl.git/blobdiff - source/animation.cpp
Use libmspmath to provide vector and matrix operations
[libs/gl.git] / source / animation.cpp
index 255e63cc8102128299076d345cb99dd8904ca6ed..c0b508180b0da9f8676cd12e6f5c74a4a77cede1 100644 (file)
@@ -223,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;
 }