From 95a4bb9ef423006acdb0c4f5ec2ed7f0fe961eaf Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Fri, 31 Mar 2017 10:42:44 -0700 Subject: [PATCH] fix transition height from hover to stand --- libraries/physics/src/CharacterController.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libraries/physics/src/CharacterController.cpp b/libraries/physics/src/CharacterController.cpp index d176958407..f98710ecc3 100755 --- a/libraries/physics/src/CharacterController.cpp +++ b/libraries/physics/src/CharacterController.cpp @@ -708,10 +708,9 @@ void CharacterController::updateState() { } case State::Hover: btScalar horizontalSpeed = (velocity - velocity.dot(_currentUp) * _currentUp).length(); - bool flyingFast = _state == State::Hover && horizontalSpeed > (MAX_WALKING_SPEED * 0.75f); + bool flyingFast = horizontalSpeed > (MAX_WALKING_SPEED * 0.75f); - if ((_floorDistance < MIN_HOVER_HEIGHT) && - !(jumpButtonHeld || flyingFast || (now - _jumpButtonDownStartTime) > JUMP_TO_HOVER_PERIOD)) { + if ((_floorDistance < MIN_HOVER_HEIGHT) && !jumpButtonHeld && !flyingFast) { SET_STATE(State::InAir, "near ground"); } else if (((_floorDistance < FLY_TO_GROUND_THRESHOLD) || _hasSupport) && !flyingFast) { SET_STATE(State::Ground, "touching ground");