mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-16 12:00:11 +02:00
fix bugs
This commit is contained in:
parent
4cb2249cda
commit
07f3abfc91
3 changed files with 10 additions and 7 deletions
|
@ -262,12 +262,10 @@ const AnimPoseVec& AnimInverseKinematics::evaluate(const AnimVariantMap& animVar
|
|||
}
|
||||
|
||||
// only update the absolutePoses that need it: those between lowestMovedIndex and _maxTargetIndex
|
||||
if (lowestMovedIndex < _maxTargetIndex) {
|
||||
for (int i = lowestMovedIndex; i < _maxTargetIndex; ++i) {
|
||||
int parentIndex = _skeleton->getParentIndex(i);
|
||||
if (parentIndex != -1) {
|
||||
absolutePoses[i] = absolutePoses[parentIndex] * _relativePoses[i];
|
||||
}
|
||||
for (int i = lowestMovedIndex; i <= _maxTargetIndex; ++i) {
|
||||
int parentIndex = _skeleton->getParentIndex(i);
|
||||
if (parentIndex != -1) {
|
||||
absolutePoses[i] = absolutePoses[parentIndex] * _relativePoses[i];
|
||||
}
|
||||
}
|
||||
} while (largestError > ACCEPTABLE_RELATIVE_ERROR && numLoops < MAX_IK_LOOPS && usecTimestampNow() < expiry);
|
||||
|
|
|
@ -20,3 +20,8 @@ void RotationAccumulator::add(glm::quat rotation) {
|
|||
glm::quat RotationAccumulator::getAverage() {
|
||||
return (_numRotations > 0) ? glm::normalize(_rotationSum) : glm::quat();
|
||||
}
|
||||
|
||||
void RotationAccumulator::clear() {
|
||||
_rotationSum *= 0.0f;
|
||||
_numRotations = 0;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public:
|
|||
|
||||
glm::quat getAverage();
|
||||
|
||||
void clear() { _numRotations = 0; }
|
||||
void clear();
|
||||
|
||||
private:
|
||||
glm::quat _rotationSum;
|
||||
|
|
Loading…
Reference in a new issue