From 051021524087a1858c7c65ff9cb8515c34f5a836 Mon Sep 17 00:00:00 2001 From: dooglifeSF <41022919+dooglifeSF@users.noreply.github.com> Date: Tue, 15 Oct 2019 17:48:06 -0700 Subject: [PATCH] Move magic number to constant for SLOW_SPEED_THRESHOLD. --- libraries/animation/src/Rig.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index e642b6bc6a..c7d06f944a 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -1435,11 +1435,12 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos //stategraph vars based on input const float INPUT_DEADZONE_THRESHOLD = 0.05f; + const float SLOW_SPEED_THRESHOLD = 1.5f; if (fabsf(_previousControllerParameters.inputX) <= INPUT_DEADZONE_THRESHOLD && fabsf(_previousControllerParameters.inputZ) <= INPUT_DEADZONE_THRESHOLD) { // no WASD input - if (fabsf(forwardSpeed) <= 1.5f && fabsf(lateralSpeed) <= 1.5f) { + if (fabsf(forwardSpeed) <= SLOW_SPEED_THRESHOLD && fabsf(lateralSpeed) <= SLOW_SPEED_THRESHOLD) { _animVars.set("isInputForward", false); _animVars.set("isInputBackward", false); _animVars.set("isInputRight", false);