History

fix for broken neck on some body models

Andrew Meadows committed 12 years ago

Commit c9ba71a1 parent f3fb3953 files · +11 −5Browse files

Showing the changes to interface/src/avatar/SkeletonModel.cpp (1 of 3 files). Show all

Unified · Split

interface/src/avatar/SkeletonModel.cpp+8−2
@@ -434,7 +434,7 @@ bool SkeletonModel::getNeckPosition(glm::vec3& neckPosition) const { · 433 unmodified lines
434434 return isActive() && getJointPositionInWorldFrame(_geometry->getFBXGeometry().neckJointIndex, neckPosition);
435435 }
436436
437−bool SkeletonModel::getNeckParentRotation(glm::quat& neckParentRotation) const {
437+bool SkeletonModel::getNeckParentRotationFromDefaultOrientation(glm::quat& neckParentRotation) const {
438438 if (!isActive()) {
439439 return false;
440440 }
@@ -442,7 +442,13 @@ bool SkeletonModel::getNeckParentRotation(glm::quat& neckParentRotation) const { · 1 unmodified line
442442 if (geometry.neckJointIndex == -1) {
443443 return false;
444444 }
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;
446452 }
447453
448454 bool SkeletonModel::getEyePositions(glm::vec3& firstEyePosition, glm::vec3& secondEyePosition) const {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t