summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuan Jose Casafranca <juan.casafranca@kdab.com>2019-04-22 12:39:32 +0200
committerSean Harmer <sean.harmer@kdab.com>2019-04-22 13:28:25 +0000
commitc9d047279713a86a32753c64c32eee75c70ddb9a (patch)
tree8ee2af6d3f523eea9da06fec4dc3d96a8af2e729
parent135bf830e67f5187de38b22fcdecb8992c3ef124 (diff)
Fix slerp interpolation when two quats are equal
Change-Id: Ibcf668adfc3d701bf2b27f9f25626f819e2445b3 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/animation/backend/animationutils.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/animation/backend/animationutils.cpp b/src/animation/backend/animationutils.cpp
index 30db10e3b..17826e946 100644
--- a/src/animation/backend/animationutils.cpp
+++ b/src/animation/backend/animationutils.cpp
@@ -274,10 +274,10 @@ ClipResults evaluateClipAtLocalTime(AnimationClip *clip, float localTime)
if (qFuzzyIsNull(omega)) {
// If the two keyframe quaternions are equal, just return the first one as the interpolated value.
- channelResults[0] = lowerQuat.scalar();
- channelResults[1] = lowerQuat.x();
- channelResults[2] = lowerQuat.y();
- channelResults[3] = lowerQuat.z();
+ channelResults[i++] = lowerQuat.scalar();
+ channelResults[i++] = lowerQuat.x();
+ channelResults[i++] = lowerQuat.y();
+ channelResults[i++] = lowerQuat.z();
} else {
for (const auto &channelComponent : qAsConst(channel.channelComponents))
channelResults[i++] = channelComponent.fcurve.evaluateAtTimeAsSlerp(localTime, lowerKeyframeBound, omega);