mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:58:51 +02:00
Add assert on mix range.
This commit is contained in:
parent
f51b5be167
commit
bb974edf7f
1 changed files with 1 additions and 0 deletions
|
@ -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 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++
|
// Sanity check: For equal blending, the formula is equivalent to mix = 1 / nAnimationsSoFar++
|
||||||
float mix = 1.0f / ((fadeSumSoFar / normalizedFade) + 1.0f);
|
float mix = 1.0f / ((fadeSumSoFar / normalizedFade) + 1.0f);
|
||||||
|
assert((0.0f <= mix) && (mix <= 1.0f));
|
||||||
fadeSumSoFar += normalizedFade;
|
fadeSumSoFar += normalizedFade;
|
||||||
handle->setMix(mix);
|
handle->setMix(mix);
|
||||||
handle->simulate(deltaTime);
|
handle->simulate(deltaTime);
|
||||||
|
|
Loading…
Reference in a new issue