From 0f1b12475e409c2e24ef6b9a72e48a6917457f61 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Tue, 6 Nov 2018 10:15:17 -0700 Subject: [PATCH] Use clamp --- libraries/animation/src/Rig.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index 33568cd85a..87f03f8bac 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -1191,8 +1191,7 @@ void Rig::updateAnimations(float deltaTime, const glm::mat4& rootTransform, cons _networkPoseSet._relativePoses = _networkNode->evaluate(_networkVars, context, deltaTime, networkTriggersOut); _networkAnimState.blendTime += deltaTime; alpha = _computeNetworkAnimation ? (_networkAnimState.blendTime / TOTAL_BLEND_TIME) : (1.0f - (_networkAnimState.blendTime / TOTAL_BLEND_TIME)); - alpha = alpha > 1.0f ? 1.0f : alpha; - alpha = alpha < 0.0f ? 0.0f : alpha; + alpha = glm::clamp(alpha, 0.0f, 1.0f); for (size_t i = 0; i < _networkPoseSet._relativePoses.size(); i++) { _networkPoseSet._relativePoses[i].blend(_internalPoseSet._relativePoses[i], alpha); }