+ if(!iter->prev)
+ return iter->keyframe->get_matrix();
+
+ return iter->matrix.get(time_since_keyframe/iter->delta_t);
+}
+
+Matrix Animation::Iterator::get_pose_matrix(unsigned link) const
+{
+ if(!animation.armature)
+ throw invalid_operation("Animation::Iterator::get_pose_matrix");
+ if(link>animation.armature->get_max_link_index())
+ throw out_of_range("Animation::Iterator::get_pose_matrix");
+
+ if(!iter->prev)
+ {
+ if(const Pose *pose = iter->keyframe->get_pose())
+ return pose->get_link_matrix(link);
+ else
+ return Matrix();
+ }
+
+ // 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-new_base)*result;
+ return result;