Add assert on mix range.

This commit is contained in:
Howard Stearns 2015-08-05 11:09:04 -07:00
parent f51b5be167
commit bb974edf7f

View file

@ -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);