From 4e1c1aec0af7ce19a60120d7826ae04bd721f2f2 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 28 Sep 2016 18:06:00 -0700 Subject: [PATCH] less magic --- libraries/physics/src/CharacterController.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/physics/src/CharacterController.cpp b/libraries/physics/src/CharacterController.cpp index 0c706e8642..c004654dd0 100755 --- a/libraries/physics/src/CharacterController.cpp +++ b/libraries/physics/src/CharacterController.cpp @@ -469,7 +469,8 @@ void CharacterController::setFollowParameters(const glm::mat4& desiredWorldBodyM float newSpeed = newFollowVelocity.length() + dontDivideByZero; float oldSpeed = _followVelocity.length(); const float VERY_SLOW_HOVER_SPEED = 0.25f; - if (oldSpeed / newSpeed > 100.0f && newSpeed < VERY_SLOW_HOVER_SPEED) { + const FAST_CHANGE_SPEED_RATIO = 100.0f; + if (oldSpeed / newSpeed > FAST_CHANGE_SPEED_RATIO && newSpeed < VERY_SLOW_HOVER_SPEED) { // avatar is stopping quickly // HACK: slam _followVelocity and _rigidBody velocity immediately _followVelocity = newFollowVelocity;