added isAway property to MyAvatar

This commit is contained in:
kunalgosar 2017-02-10 17:27:14 -08:00
parent e6142d9719
commit 691f61983a
2 changed files with 20 additions and 0 deletions

View file

@ -88,6 +88,7 @@ MyAvatar::MyAvatar(RigPointer rig) :
_isPushing(false),
_isBeingPushed(false),
_isBraking(false),
_isAway(false),
_boomLength(ZOOM_DEFAULT),
_yawSpeed(YAW_SPEED_DEFAULT),
_pitchSpeed(PITCH_SPEED_DEFAULT),
@ -2359,6 +2360,19 @@ bool MyAvatar::hasDriveInput() const {
return fabsf(_driveKeys[TRANSLATE_X]) > 0.0f || fabsf(_driveKeys[TRANSLATE_Y]) > 0.0f || fabsf(_driveKeys[TRANSLATE_Z]) > 0.0f;
}
void MyAvatar::setAway(bool value) {
_isAway = value;
if (_isAway) {
emit wentAway();
} else {
emit wentActive();
}
}
bool MyAvatar::getIsAway() {
return _isAway;
}
// The resulting matrix is used to render the hand controllers, even if the camera is decoupled from the avatar.
// Specificly, if we are rendering using a third person camera. We would like to render the hand controllers in front of the camera,
// not in front of the avatar.

View file

@ -82,6 +82,7 @@ class MyAvatar : public Avatar {
Q_PROPERTY(controller::Pose rightHandTipPose READ getRightHandTipPose)
Q_PROPERTY(float energy READ getEnergy WRITE setEnergy)
Q_PROPERTY(float isAway READ getIsAway WRITE setAway)
Q_PROPERTY(bool hmdLeanRecenterEnabled READ getHMDLeanRecenterEnabled WRITE setHMDLeanRecenterEnabled)
Q_PROPERTY(bool characterControllerEnabled READ getCharacterControllerEnabled WRITE setCharacterControllerEnabled)
@ -328,6 +329,8 @@ signals:
void energyChanged(float newEnergy);
void positionGoneTo();
void onLoadComplete();
void wentAway();
void wentActive();
private:
@ -385,6 +388,7 @@ private:
bool _isPushing;
bool _isBeingPushed;
bool _isBraking;
bool _isAway;
float _boomLength;
float _yawSpeed; // degrees/sec
@ -519,6 +523,8 @@ private:
float getEnergy();
void setEnergy(float value);
bool didTeleport();
void setAway(bool value);
bool getIsAway();
};
QScriptValue audioListenModeToScriptValue(QScriptEngine* engine, const AudioListenerMode& audioListenerMode);