AnimClip: special case the translation on the eyes

This commit is contained in:
Anthony J. Thibault 2016-01-25 18:47:45 -08:00
parent 3cee3cbb5a
commit 3b062b7a31

View file

@ -156,7 +156,10 @@ void AnimClip::copyFromNetworkAnim() {
}
AnimPose trans;
if (usePreAndPostPoseFromAnim) {
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));