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:
Menithal 2017-06-14 20:18:04 +03:00
parent 66d43b80e2
commit a1c2f71f30

View file

@ -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() {