diff --git a/libraries/animation/src/AnimInverseKinematics.cpp b/libraries/animation/src/AnimInverseKinematics.cpp index db8799db46..621323575f 100644 --- a/libraries/animation/src/AnimInverseKinematics.cpp +++ b/libraries/animation/src/AnimInverseKinematics.cpp @@ -362,12 +362,12 @@ void AnimInverseKinematics::solve(const AnimContext& context, const std::vector< _relativePoses[tipIndex].rot() = safeMix(_relativePoses[tipIndex].rot(), newRelativeRotation, alpha); } else { _relativePoses[tipIndex].rot() = newRelativeRotation; - // Add last known rotations to interpolate from - if (_rotationOnlyIKRotations.find(tipIndex) == _rotationOnlyIKRotations.end()) { - _rotationOnlyIKRotations.insert(std::pair(tipIndex, newRelativeRotation)); - } else { - _rotationOnlyIKRotations[tipIndex] = newRelativeRotation; - } + } + // Add last known rotations to interpolate from + if (_rotationOnlyIKRotations.find(tipIndex) == _rotationOnlyIKRotations.end()) { + _rotationOnlyIKRotations.insert(std::pair(tipIndex, _relativePoses[tipIndex].rot())); + } else { + _rotationOnlyIKRotations[tipIndex] = _relativePoses[tipIndex].rot(); } absolutePoses[tipIndex].rot() = targetRotation; } else {