From bb974edf7f5d74d2bb8a418e869f727fffb8b0ec Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Wed, 5 Aug 2015 11:09:04 -0700 Subject: [PATCH] Add assert on mix range. --- libraries/animation/src/Rig.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index 43b2892cbf..ec34e90b5c 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -482,6 +482,7 @@ void Rig::updateAnimations(float deltaTime, glm::mat4 parentTransform) { // Sanity check: For the first animation, fadeSum = 0, and the mix will always be 1. // Sanity check: For equal blending, the formula is equivalent to mix = 1 / nAnimationsSoFar++ float mix = 1.0f / ((fadeSumSoFar / normalizedFade) + 1.0f); + assert((0.0f <= mix) && (mix <= 1.0f)); fadeSumSoFar += normalizedFade; handle->setMix(mix); handle->simulate(deltaTime);