minor IK optimization: changed accumulators only

This commit is contained in:
Andrew Meadows 2016-01-29 10:36:22 -08:00
parent 449d566d2a
commit a98459dfa8

View file

@ -164,14 +164,14 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
// harvest accumulated rotations and apply the average
const int numJoints = (int)_accumulators.size();
for (int i = 0; i < numJoints; ++i) {
for (int i = lowestMovedIndex; i < _maxTargetIndex; ++i) {
if (_accumulators[i].size() > 0) {
_relativePoses[i].rot = _accumulators[i].getAverage();
_accumulators[i].clear();
}
}
// only update the absolutePoses that need it: those between lowestMovedIndex and _maxTargetIndex
// update the absolutePoses that need it (from lowestMovedIndex to _maxTargetIndex)
for (auto i = lowestMovedIndex; i <= _maxTargetIndex; ++i) {
auto parentIndex = _skeleton->getParentIndex((int)i);
if (parentIndex != -1) {