Added getters for State if in Air or Flying

This commit is contained in:
Menithal 2017-06-14 19:53:08 +03:00
parent c92e22fd20
commit 66d43b80e2
2 changed files with 10 additions and 0 deletions

View file

@ -2476,6 +2476,14 @@ void MyAvatar::setFlyingEnabled(bool enabled) {
_enableFlying = enabled;
}
bool MyAvatar::isFlying() {
return _characterController.getState() == CharacterController::State::Hover;
}
bool MyAvatar::isInAir() {
return _characterController.getState() == CharacterController::State::InAir;
}
bool MyAvatar::getFlyingEnabled() {
return _enableFlying;
}

View file

@ -491,6 +491,8 @@ public:
bool hasDriveInput() const;
Q_INVOKABLE bool isFlying();
Q_INVOKABLE bool isInAir();
Q_INVOKABLE void setFlyingEnabled(bool enabled);
Q_INVOKABLE bool getFlyingEnabled();