dynamicallyAdjustLimits on the underPoses not the relaxed poses.

This commit is contained in:
Anthony J. Thibault 2017-04-24 09:56:10 -07:00
parent 22e79504bb
commit 47e51493e8

View file

@ -426,13 +426,13 @@ const AnimPoseVec& AnimInverseKinematics::overlay(const AnimVariantMap& animVars
_relativePoses[i].trans() = underPoses[i].trans(); _relativePoses[i].trans() = underPoses[i].trans();
} }
if (!_relativePoses.empty()) { if (!underPoses.empty()) {
// Sometimes the underpose itself can violate the constraints. Rather than // Sometimes the underpose itself can violate the constraints. Rather than
// clamp the animation we dynamically expand each constraint to accomodate it. // clamp the animation we dynamically expand each constraint to accomodate it.
std::map<int, RotationConstraint*>::iterator constraintItr = _constraints.begin(); std::map<int, RotationConstraint*>::iterator constraintItr = _constraints.begin();
while (constraintItr != _constraints.end()) { while (constraintItr != _constraints.end()) {
int index = constraintItr->first; int index = constraintItr->first;
constraintItr->second->dynamicallyAdjustLimits(_relativePoses[index].rot()); constraintItr->second->dynamicallyAdjustLimits(underPoses[index].rot());
++constraintItr; ++constraintItr;
} }
} }