properly track lowestMovedIndex

This commit is contained in:
Andrew Meadows 2016-01-29 10:31:00 -08:00
parent 48f6a9c05f
commit 449d566d2a

View file

@ -156,7 +156,10 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
// solve all targets
int lowestMovedIndex = (int)_relativePoses.size();
for (auto& target: targets) {
lowestMovedIndex = solveTargetWithCCD(target, absolutePoses);
int lowIndex = solveTargetWithCCD(target, absolutePoses);
if (lowIndex < lowestMovedIndex) {
lowestMovedIndex = lowIndex;
}
}
// harvest accumulated rotations and apply the average