Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 3 files). Show all
Unified · Split
| @@ -434,7 +434,7 @@ bool SkeletonModel::getNeckPosition(glm::vec3& neckPosition) const { · 433 unmodified lines | ||
| 434 | 434 | return isActive() && getJointPositionInWorldFrame(_geometry->getFBXGeometry().neckJointIndex, neckPosition); |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | −bool SkeletonModel::getNeckParentRotation(glm::quat& neckParentRotation) const { | |
| 437 | +bool SkeletonModel::getNeckParentRotationFromDefaultOrientation(glm::quat& neckParentRotation) const { | |
| 438 | 438 | if (!isActive()) { |
| 439 | 439 | return false; |
| 440 | 440 | } |
| @@ -442,7 +442,13 @@ bool SkeletonModel::getNeckParentRotation(glm::quat& neckParentRotation) const { · 1 unmodified line | ||
| 442 | 442 | if (geometry.neckJointIndex == -1) { |
| 443 | 443 | return false; |
| 444 | 444 | } |
| 445 | − return getJointRotationInWorldFrame(geometry.joints.at(geometry.neckJointIndex).parentIndex, neckParentRotation); | |
| 445 | + int parentIndex = geometry.joints.at(geometry.neckJointIndex).parentIndex; | |
| 446 | + glm::quat worldFrameRotation; | |
| 447 | + if (getJointRotationInWorldFrame(parentIndex, worldFrameRotation)) { | |
| 448 | + neckParentRotation = worldFrameRotation * _jointStates[parentIndex].getFBXJoint().inverseDefaultRotation; | |
| 449 | + return true; | |
| 450 | + } | |
| 451 | + return false; | |
| 446 | 452 | } |
| 447 | 453 | |
| 448 | 454 | bool SkeletonModel::getEyePositions(glm::vec3& firstEyePosition, glm::vec3& secondEyePosition) const { |