mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
another round of small adjustments
This commit is contained in:
parent
6d8fe870e4
commit
3cc54c5118
1 changed files with 3 additions and 2 deletions
|
@ -763,8 +763,9 @@ void CharacterController::updateState() {
|
||||||
case State::Hover:
|
case State::Hover:
|
||||||
btScalar horizontalSpeed = (velocity - velocity.dot(_currentUp) * _currentUp).length();
|
btScalar horizontalSpeed = (velocity - velocity.dot(_currentUp) * _currentUp).length();
|
||||||
bool flyingFast = horizontalSpeed > (MAX_WALKING_SPEED * 0.75f);
|
bool flyingFast = horizontalSpeed > (MAX_WALKING_SPEED * 0.75f);
|
||||||
|
if (!_flyingAllowed && rayHasHit) {
|
||||||
if ((_floorDistance < MIN_HOVER_HEIGHT) && !jumpButtonHeld && !flyingFast) {
|
SET_STATE(State::InAir, "flying not allowed");
|
||||||
|
} else if ((_floorDistance < MIN_HOVER_HEIGHT) && !jumpButtonHeld && !flyingFast) {
|
||||||
SET_STATE(State::InAir, "near ground");
|
SET_STATE(State::InAir, "near ground");
|
||||||
} else if (((_floorDistance < FLY_TO_GROUND_THRESHOLD) || _hasSupport) && !flyingFast) {
|
} else if (((_floorDistance < FLY_TO_GROUND_THRESHOLD) || _hasSupport) && !flyingFast) {
|
||||||
SET_STATE(State::Ground, "touching ground");
|
SET_STATE(State::Ground, "touching ground");
|
||||||
|
|
Loading…
Reference in a new issue