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
434 return isActive() && getJointPositionInWorldFrame(_geometry->getFBXGeometry().neckJointIndex, neckPosition);434 return isActive() && getJointPositionInWorldFrame(_geometry->getFBXGeometry().neckJointIndex, neckPosition);
435}435}
436 436
437bool SkeletonModel::getNeckParentRotation(glm::quat& neckParentRotation) const {437bool SkeletonModel::getNeckParentRotationFromDefaultOrientation(glm::quat& neckParentRotation) const {
438 if (!isActive()) {438 if (!isActive()) {
439 return false;439 return false;
440 }440 }
@@ -442,7 +442,13 @@ bool SkeletonModel::getNeckParentRotation(glm::quat& neckParentRotation) const { · 1 unmodified line
442 if (geometry.neckJointIndex == -1) {442 if (geometry.neckJointIndex == -1) {
443 return false;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
448bool SkeletonModel::getEyePositions(glm::vec3& firstEyePosition, glm::vec3& secondEyePosition) const {454bool 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