From 9b9b62d0e4e2c1211ab27b50ec8dceb721352187 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Fri, 9 Mar 2018 15:20:51 -0800 Subject: [PATCH] Transition to hover if falling and height above ground is greater than the threshold. --- libraries/physics/src/CharacterController.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/physics/src/CharacterController.cpp b/libraries/physics/src/CharacterController.cpp index d39930ab76..9b6e9fe7a0 100755 --- a/libraries/physics/src/CharacterController.cpp +++ b/libraries/physics/src/CharacterController.cpp @@ -756,6 +756,9 @@ void CharacterController::updateState() { SET_STATE(State::Hover, "double jump button"); } else if ((jumpButtonHeld || vertTargetSpeedIsNonZero) && (now - _jumpButtonDownStartTime) > JUMP_TO_HOVER_PERIOD) { SET_STATE(State::Hover, "jump button held"); + } else if (_floorDistance > _scaleFactor * DEFAULT_AVATAR_FALL_HEIGHT) { + // Transition to hover if we are above the fall threshold + SET_STATE(State::Hover, "above fall threshold"); } } break;