History

JointState has our own copy of any ivars we want from FBXJoint, instead of keeping a reference to the fbx.

Howard Stearns committed 11 years ago

Commit 42cc34c1 parent a4f105f9 files · +131 −84Browse files

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

Unified · Split

interface/src/avatar/SkeletonModel.cpp+6−7
@@ -401,7 +401,7 @@ bool SkeletonModel::getNeckParentRotationFromDefaultOrientation(glm::quat& neckP · 400 unmodified lines
401401 glm::quat worldFrameRotation;
402402 bool success = getJointRotationInWorldFrame(parentIndex, worldFrameRotation);
403403 if (success) {
404− neckParentRotation = worldFrameRotation * _rig->getJointState(parentIndex).getFBXJoint().inverseDefaultRotation;
404+ neckParentRotation = worldFrameRotation * _rig->getJointState(parentIndex).getInverseDefaultRotation();
405405 }
406406 return success;
407407 }
@@ -477,18 +477,17 @@ void SkeletonModel::computeBoundingShape(const FBXGeometry& geometry) { · 69 unmodified lines
477477 for (int i = 0; i < numStates; i++) {
478478 // compute the default transform of this joint
479479 const JointState& state = _rig->getJointState(i);
480− const FBXJoint& joint = state.getFBXJoint();
481− int parentIndex = joint.parentIndex;
480+ int parentIndex = state.getParentIndex();
482481 if (parentIndex == -1) {
483482 transforms[i] = _rig->getJointTransform(i);
484483 } 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();
488487 }
489488
490489 // Each joint contributes a sphere at its position
491− glm::vec3 axis(joint.boneRadius);
490+ glm::vec3 axis(state.getBoneRadius());
492491 glm::vec3 jointPosition = extractTranslation(transforms[i]);
493492 totalExtents.addPoint(jointPosition + axis);
494493 totalExtents.addPoint(jointPosition - axis);

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