mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 03:04:33 +02:00
Added couple of state getters
This allow scripts to check if avatar is flying or if the avatar is in air (but not flying). Both of these allows one to distinguish if the avatar is flying or falling or just jumping with Velocity
This commit is contained in:
parent
66d43b80e2
commit
a1c2f71f30
1 changed files with 3 additions and 1 deletions
|
@ -2477,11 +2477,13 @@ void MyAvatar::setFlyingEnabled(bool enabled) {
|
|||
}
|
||||
|
||||
bool MyAvatar::isFlying() {
|
||||
// Avatar is Flying, and is not Falling, or Taking off
|
||||
return _characterController.getState() == CharacterController::State::Hover;
|
||||
}
|
||||
|
||||
bool MyAvatar::isInAir() {
|
||||
return _characterController.getState() == CharacterController::State::InAir;
|
||||
// If Avatar is Hover, Falling, or Taking off, they are in Air.
|
||||
return _characterController.getState() != CharacterController::State::Ground;
|
||||
}
|
||||
|
||||
bool MyAvatar::getFlyingEnabled() {
|
||||
|
|
Loading…
Reference in a new issue