(use corresponding data in FBXJoint instead)
Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 4 files). Show all
Unified · Split
| @@ -230,7 +230,7 @@ void SkeletonModel::maybeUpdateLeanRotation(const JointState& parentState, const · 229 unmodified lines | |||
| 230 | } | 230 | } |
| 231 | // get the rotation axes in joint space and use them to adjust the rotation | 231 | // get the rotation axes in joint space and use them to adjust the rotation |
| 232 | glm::mat3 axes = glm::mat3_cast(_rotation); | 232 | glm::mat3 axes = glm::mat3_cast(_rotation); |
| 233 | glm::mat3 inverse = glm::mat3(glm::inverse(parentState._transform * glm::translate(state._translation) * | 233 | glm::mat3 inverse = glm::mat3(glm::inverse(parentState._transform * glm::translate(state.getDefaultTranslationInParentFrame()) * |
| 234 | joint.preTransform * glm::mat4_cast(joint.preRotation * joint.rotation))); | 234 | joint.preTransform * glm::mat4_cast(joint.preRotation * joint.rotation))); |
| 235 | state._rotation = glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getFinalLeanSideways(), | 235 | state._rotation = glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getFinalLeanSideways(), |
| 236 | glm::normalize(inverse * axes[2])) * glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getFinalLeanForward(), | 236 | glm::normalize(inverse * axes[2])) * glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getFinalLeanForward(), |