less magic

This commit is contained in:
Andrew Meadows 2016-09-28 18:06:00 -07:00
parent a10ae20bf7
commit 4e1c1aec0a

View file

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