mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 01:17:14 +02:00
minor IK optimization: changed accumulators only
This commit is contained in:
parent
449d566d2a
commit
a98459dfa8
1 changed files with 2 additions and 2 deletions
|
@ -164,14 +164,14 @@ void AnimInverseKinematics::solveWithCyclicCoordinateDescent(const std::vector<I
|
||||||
|
|
||||||
// harvest accumulated rotations and apply the average
|
// harvest accumulated rotations and apply the average
|
||||||
const int numJoints = (int)_accumulators.size();
|
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) {
|
if (_accumulators[i].size() > 0) {
|
||||||
_relativePoses[i].rot = _accumulators[i].getAverage();
|
_relativePoses[i].rot = _accumulators[i].getAverage();
|
||||||
_accumulators[i].clear();
|
_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) {
|
for (auto i = lowestMovedIndex; i <= _maxTargetIndex; ++i) {
|
||||||
auto parentIndex = _skeleton->getParentIndex((int)i);
|
auto parentIndex = _skeleton->getParentIndex((int)i);
|
||||||
if (parentIndex != -1) {
|
if (parentIndex != -1) {
|
||||||
|
|
Loading…
Reference in a new issue