Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 9 files). Show all
Unified · Split
| @@ -401,7 +401,7 @@ bool SkeletonModel::getNeckParentRotationFromDefaultOrientation(glm::quat& neckP · 400 unmodified lines | ||
| 401 | 401 | glm::quat worldFrameRotation; |
| 402 | 402 | bool success = getJointRotationInWorldFrame(parentIndex, worldFrameRotation); |
| 403 | 403 | if (success) { |
| 404 | − neckParentRotation = worldFrameRotation * _rig->getJointState(parentIndex).getFBXJoint().inverseDefaultRotation; | |
| 404 | + neckParentRotation = worldFrameRotation * _rig->getJointState(parentIndex).getInverseDefaultRotation(); | |
| 405 | 405 | } |
| 406 | 406 | return success; |
| 407 | 407 | } |
| @@ -477,18 +477,17 @@ void SkeletonModel::computeBoundingShape(const FBXGeometry& geometry) { · 69 unmodified lines | ||
| 477 | 477 | for (int i = 0; i < numStates; i++) { |
| 478 | 478 | // compute the default transform of this joint |
| 479 | 479 | const JointState& state = _rig->getJointState(i); |
| 480 | − const FBXJoint& joint = state.getFBXJoint(); | |
| 481 | − int parentIndex = joint.parentIndex; | |
| 480 | + int parentIndex = state.getParentIndex(); | |
| 482 | 481 | if (parentIndex == -1) { |
| 483 | 482 | transforms[i] = _rig->getJointTransform(i); |
| 484 | 483 | } else { |
| 485 | − glm::quat modifiedRotation = joint.preRotation * joint.rotation * joint.postRotation; | |
| 486 | − transforms[i] = transforms[parentIndex] * glm::translate(joint.translation) | |
| 487 | − * joint.preTransform * glm::mat4_cast(modifiedRotation) * joint.postTransform; | |
| 484 | + glm::quat modifiedRotation = state.getPreRotation() * state.getOriginalRotation() * state.getPostRotation(); | |
| 485 | + transforms[i] = transforms[parentIndex] * glm::translate(state.getTranslation()) | |
| 486 | + * state.getPreTransform() * glm::mat4_cast(modifiedRotation) * state.getPostTransform(); | |
| 488 | 487 | } |
| 489 | 488 | |
| 490 | 489 | // Each joint contributes a sphere at its position |
| 491 | − glm::vec3 axis(joint.boneRadius); | |
| 490 | + glm::vec3 axis(state.getBoneRadius()); | |
| 492 | 491 | glm::vec3 jointPosition = extractTranslation(transforms[i]); |
| 493 | 492 | totalExtents.addPoint(jointPosition + axis); |
| 494 | 493 | totalExtents.addPoint(jointPosition - axis); |