From a1c2f71f3075bb7c82d6ec970e457f4276b46e3c Mon Sep 17 00:00:00 2001 From: Menithal Date: Wed, 14 Jun 2017 20:18:04 +0300 Subject: [PATCH] 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 --- interface/src/avatar/MyAvatar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index d8c27ba0d8..6d0c3a15fa 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -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() {