diff --git a/libraries/animation/src/AnimInverseKinematics.cpp b/libraries/animation/src/AnimInverseKinematics.cpp index c8388c3b12..e9f9f8818f 100644 --- a/libraries/animation/src/AnimInverseKinematics.cpp +++ b/libraries/animation/src/AnimInverseKinematics.cpp @@ -1255,7 +1255,7 @@ void AnimInverseKinematics::initConstraints() { // / / // O--O O--O - loadDefaultPoses(_skeleton->getRelativeBindPoses()); + loadDefaultPoses(_skeleton->getRelativeDefaultPoses()); int numJoints = (int)_defaultRelativePoses.size(); diff --git a/libraries/animation/src/AnimManipulator.cpp b/libraries/animation/src/AnimManipulator.cpp index 070949ab3b..46b3cf1c28 100644 --- a/libraries/animation/src/AnimManipulator.cpp +++ b/libraries/animation/src/AnimManipulator.cpp @@ -33,7 +33,7 @@ AnimManipulator::~AnimManipulator() { } const AnimPoseVec& AnimManipulator::evaluate(const AnimVariantMap& animVars, const AnimContext& context, float dt, Triggers& triggersOut) { - return overlay(animVars, context, dt, triggersOut, _skeleton->getRelativeBindPoses()); + return overlay(animVars, context, dt, triggersOut, _skeleton->getRelativeDefaultPoses()); } const AnimPoseVec& AnimManipulator::overlay(const AnimVariantMap& animVars, const AnimContext& context, float dt, Triggers& triggersOut, const AnimPoseVec& underPoses) { diff --git a/libraries/animation/src/AnimSkeleton.cpp b/libraries/animation/src/AnimSkeleton.cpp index 804ffb0583..2bce16c5ca 100644 --- a/libraries/animation/src/AnimSkeleton.cpp +++ b/libraries/animation/src/AnimSkeleton.cpp @@ -56,14 +56,6 @@ int AnimSkeleton::getChainDepth(int jointIndex) const { } } -const AnimPose& AnimSkeleton::getAbsoluteBindPose(int jointIndex) const { - return _absoluteBindPoses[jointIndex]; -} - -const AnimPose& AnimSkeleton::getRelativeBindPose(int jointIndex) const { - return _relativeBindPoses[jointIndex]; -} - const AnimPose& AnimSkeleton::getRelativeDefaultPose(int jointIndex) const { return _relativeDefaultPoses[jointIndex]; } @@ -164,8 +156,6 @@ void AnimSkeleton::buildSkeletonFromJoints(const std::vector& joints) _joints = joints; _jointsSize = (int)joints.size(); // build a cache of bind poses - _absoluteBindPoses.reserve(_jointsSize); - _relativeBindPoses.reserve(_jointsSize); // build a chache of default poses _absoluteDefaultPoses.reserve(_jointsSize); @@ -192,28 +182,6 @@ void AnimSkeleton::buildSkeletonFromJoints(const std::vector& joints) } else { _absoluteDefaultPoses.push_back(relDefaultPose); } - - // build relative and absolute bind poses - if (_joints[i].bindTransformFoundInCluster) { - // Use the FBXJoint::bindTransform, which is absolute model coordinates - // i.e. not relative to it's parent. - AnimPose absoluteBindPose(_joints[i].bindTransform); - _absoluteBindPoses.push_back(absoluteBindPose); - if (parentIndex >= 0) { - AnimPose inverseParentAbsoluteBindPose = _absoluteBindPoses[parentIndex].inverse(); - _relativeBindPoses.push_back(inverseParentAbsoluteBindPose * absoluteBindPose); - } else { - _relativeBindPoses.push_back(absoluteBindPose); - } - } else { - // use default transform instead - _relativeBindPoses.push_back(relDefaultPose); - if (parentIndex >= 0) { - _absoluteBindPoses.push_back(_absoluteBindPoses[parentIndex] * relDefaultPose); - } else { - _absoluteBindPoses.push_back(relDefaultPose); - } - } } for (int i = 0; i < _jointsSize; i++) { @@ -251,8 +219,6 @@ void AnimSkeleton::dump(bool verbose) const { qCDebug(animation) << " {"; qCDebug(animation) << " index =" << i; qCDebug(animation) << " name =" << getJointName(i); - qCDebug(animation) << " absBindPose =" << getAbsoluteBindPose(i); - qCDebug(animation) << " relBindPose =" << getRelativeBindPose(i); qCDebug(animation) << " absDefaultPose =" << getAbsoluteDefaultPose(i); qCDebug(animation) << " relDefaultPose =" << getRelativeDefaultPose(i); if (verbose) { @@ -287,8 +253,6 @@ void AnimSkeleton::dump(const AnimPoseVec& poses) const { qCDebug(animation) << " {"; qCDebug(animation) << " index =" << i; qCDebug(animation) << " name =" << getJointName(i); - qCDebug(animation) << " absBindPose =" << getAbsoluteBindPose(i); - qCDebug(animation) << " relBindPose =" << getRelativeBindPose(i); qCDebug(animation) << " absDefaultPose =" << getAbsoluteDefaultPose(i); qCDebug(animation) << " relDefaultPose =" << getRelativeDefaultPose(i); qCDebug(animation) << " pose =" << poses[i]; diff --git a/libraries/animation/src/AnimSkeleton.h b/libraries/animation/src/AnimSkeleton.h index 99c9a148f7..664358f414 100644 --- a/libraries/animation/src/AnimSkeleton.h +++ b/libraries/animation/src/AnimSkeleton.h @@ -30,13 +30,6 @@ public: int getNumJoints() const; int getChainDepth(int jointIndex) const; - // absolute pose, not relative to parent - const AnimPose& getAbsoluteBindPose(int jointIndex) const; - - // relative to parent pose - const AnimPose& getRelativeBindPose(int jointIndex) const; - const AnimPoseVec& getRelativeBindPoses() const { return _relativeBindPoses; } - // the default poses are the orientations of the joints on frame 0. const AnimPose& getRelativeDefaultPose(int jointIndex) const; const AnimPoseVec& getRelativeDefaultPoses() const { return _relativeDefaultPoses; } @@ -72,8 +65,6 @@ protected: std::vector _joints; int _jointsSize { 0 }; - AnimPoseVec _absoluteBindPoses; - AnimPoseVec _relativeBindPoses; AnimPoseVec _relativeDefaultPoses; AnimPoseVec _absoluteDefaultPoses; AnimPoseVec _relativePreRotationPoses;