AnimClip: consistent application of translations

Apply animation translation the same way regardless of state of usePreAndPostPoseFromAnimation.
This commit is contained in:
Anthony J. Thibault 2016-01-26 10:53:21 -08:00
parent 3b062b7a31
commit 69d833a6c0

View file

@ -155,15 +155,7 @@ void AnimClip::copyFromNetworkAnim() {
boneLengthScale = glm::length(relDefaultPose.trans) / glm::length(fbxZeroTrans);
}
AnimPose trans;
if (_skeleton->getJointName(skeletonJoint) == "RightEye" || _skeleton->getJointName(skeletonJoint) == "LeftEye") {
// preserve model eye translation
trans = AnimPose(glm::vec3(1.0f), glm::quat(), relDefaultPose.trans);
} else if (usePreAndPostPoseFromAnim) {
trans = AnimPose(glm::vec3(1.0f), glm::quat(), boneLengthScale * (fbxAnimTrans + (fbxAnimTrans - fbxZeroTrans)));
} else {
trans = AnimPose(glm::vec3(1.0f), glm::quat(), relDefaultPose.trans + boneLengthScale * (fbxAnimTrans - fbxZeroTrans));
}
AnimPose trans = AnimPose(glm::vec3(1.0f), glm::quat(), relDefaultPose.trans + boneLengthScale * (fbxAnimTrans - fbxZeroTrans));
_anim[frame][skeletonJoint] = trans * preRot * rot * postRot;
}