mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 02:17:11 +02:00
fall when flying not allowed
This commit is contained in:
parent
75c1bdbf0d
commit
5553752d81
1 changed files with 2 additions and 4 deletions
|
@ -784,15 +784,13 @@ void CharacterController::updateState() {
|
|||
// Transition to hover if we are above the fall threshold
|
||||
SET_STATE(State::Hover, "above fall threshold");
|
||||
}
|
||||
} else if (!rayHasHit && !_hasSupport) {
|
||||
SET_STATE(State::Hover, "no ground detected");
|
||||
}
|
||||
break;
|
||||
}
|
||||
case State::Hover:
|
||||
btScalar horizontalSpeed = (velocity - velocity.dot(_currentUp) * _currentUp).length();
|
||||
bool flyingFast = horizontalSpeed > (MAX_WALKING_SPEED * 0.75f);
|
||||
if (!_flyingAllowed && rayHasHit) {
|
||||
if (!_flyingAllowed) {
|
||||
SET_STATE(State::InAir, "flying not allowed");
|
||||
} else if ((_floorDistance < MIN_HOVER_HEIGHT) && !jumpButtonHeld && !flyingFast) {
|
||||
SET_STATE(State::InAir, "near ground");
|
||||
|
|
Loading…
Reference in a new issue