Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 5 files). Show all
Unified · Split
| @@ -220,7 +220,7 @@ void SkeletonModel::applyPalmData(int jointIndex, PalmData& palm) { · 219 unmodified lines | |||
| 220 | JointState& parentState = _jointStates[parentJointIndex]; | 220 | JointState& parentState = _jointStates[parentJointIndex]; |
| 221 | parentState.setRotationFromBindFrame(palmRotation, PALM_PRIORITY); | 221 | parentState.setRotationFromBindFrame(palmRotation, PALM_PRIORITY); |
| 222 | // lock hand to forearm by slamming its rotation (in parent-frame) to identity | 222 | // lock hand to forearm by slamming its rotation (in parent-frame) to identity |
| 223 | _jointStates[jointIndex]._rotationInParentFrame = glm::quat(); | 223 | _jointStates[jointIndex].setRotationInParentFrame(glm::quat()); |
| 224 | } else { | 224 | } else { |
| 225 | setJointPosition(jointIndex, palmPosition, palmRotation, | 225 | setJointPosition(jointIndex, palmPosition, palmRotation, |
| 226 | true, -1, false, glm::vec3(0.0f, -1.0f, 0.0f), PALM_PRIORITY); | 226 | true, -1, false, glm::vec3(0.0f, -1.0f, 0.0f), PALM_PRIORITY); |
| @@ -259,9 +259,9 @@ void SkeletonModel::maybeUpdateLeanRotation(const JointState& parentState, const · 32 unmodified lines | |||
| 259 | glm::mat3 axes = glm::mat3_cast(glm::quat()); | 259 | glm::mat3 axes = glm::mat3_cast(glm::quat()); |
| 260 | glm::mat3 inverse = glm::mat3(glm::inverse(parentState.getTransform() * glm::translate(state.getDefaultTranslationInParentFrame()) * | 260 | glm::mat3 inverse = glm::mat3(glm::inverse(parentState.getTransform() * glm::translate(state.getDefaultTranslationInParentFrame()) * |
| 261 | joint.preTransform * glm::mat4_cast(joint.preRotation * joint.rotation))); | 261 | joint.preTransform * glm::mat4_cast(joint.preRotation * joint.rotation))); |
| 262 | state._rotationInParentFrame = glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getFinalLeanSideways(), | 262 | state.setRotationInParentFrame(glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getFinalLeanSideways(), |
| 263 | glm::normalize(inverse * axes[2])) * glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getFinalLeanForward(), | 263 | glm::normalize(inverse * axes[2])) * glm::angleAxis(- RADIANS_PER_DEGREE * _owningAvatar->getHead()->getFinalLeanForward(), |
| 264 | glm::normalize(inverse * axes[0])) * joint.rotation; | 264 | glm::normalize(inverse * axes[0])) * joint.rotation); |
| 265 | } | 265 | } |
| 266 | 266 | ||
| 267 | void SkeletonModel::maybeUpdateNeckRotation(const JointState& parentState, const FBXJoint& joint, JointState& state) { | 267 | void SkeletonModel::maybeUpdateNeckRotation(const JointState& parentState, const FBXJoint& joint, JointState& state) { |