Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 5 files). Show all
Unified · Split
| @@ -219,7 +219,7 @@ void SkeletonModel::applyPalmData(int jointIndex, PalmData& palm) { · 218 unmodified lines | |||
| 219 | JointState& parentState = _jointStates[parentJointIndex]; | 219 | JointState& parentState = _jointStates[parentJointIndex]; |
| 220 | parentState.setRotationFromBindFrame(palmRotation, PALM_PRIORITY); | 220 | parentState.setRotationFromBindFrame(palmRotation, PALM_PRIORITY); |
| 221 | // lock hand to forearm by slamming its rotation (in parent-frame) to identity | 221 | // lock hand to forearm by slamming its rotation (in parent-frame) to identity |
| 222 | _jointStates[jointIndex].setRotationInParentFrame(glm::quat()); | 222 | _jointStates[jointIndex].setRotationInConstrainedFrame(glm::quat()); |
| 223 | } else { | 223 | } else { |
| 224 | inverseKinematics(jointIndex, palmPosition, palmRotation, PALM_PRIORITY); | 224 | inverseKinematics(jointIndex, palmPosition, palmRotation, PALM_PRIORITY); |
| 225 | } | 225 | } |
| @@ -255,9 +255,9 @@ void SkeletonModel::maybeUpdateLeanRotation(const JointState& parentState, const · 29 unmodified lines | |||
| 255 | } | 255 | } |
| 256 | // get the rotation axes in joint space and use them to adjust the rotation | 256 | // get the rotation axes in joint space and use them to adjust the rotation |
| 257 | glm::mat3 axes = glm::mat3_cast(glm::quat()); | 257 | glm::mat3 axes = glm::mat3_cast(glm::quat()); |
| 258 | glm::mat3 inverse = glm::mat3(glm::inverse(parentState.getTransform() * glm::translate(state.getDefaultTranslationInParentFrame()) * | 258 | glm::mat3 inverse = glm::mat3(glm::inverse(parentState.getTransform() * glm::translate(state.getDefaultTranslationInConstrainedFrame()) * |
| 259 | joint.preTransform * glm::mat4_cast(joint.preRotation * joint.rotation))); | 259 | joint.preTransform * glm::mat4_cast(joint.preRotation * joint.rotation))); |
| 260 | state.setRotationInParentFrame(glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getFinalLeanSideways(), | 260 | state.setRotationInConstrainedFrame(glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getFinalLeanSideways(), |
| 261 | glm::normalize(inverse * axes[2])) * glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getFinalLeanForward(), | 261 | glm::normalize(inverse * axes[2])) * glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getFinalLeanForward(), |
| 262 | glm::normalize(inverse * axes[0])) * joint.rotation); | 262 | glm::normalize(inverse * axes[0])) * joint.rotation); |
| 263 | } | 263 | } |