From 3a9c829c95da05dfb392c4c86c2db36a2ec871ed Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Fri, 4 Oct 2019 11:07:49 -0700 Subject: [PATCH 1/2] Add MyAvatar::isSeated API method --- interface/src/avatar/MyAvatar.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 3dcbc2634d..127b0ae83c 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -272,12 +272,12 @@ class MyAvatar : public Avatar { * the value.

* @property {number} analogPlusSprintSpeed - The sprint (run) speed of your avatar for the "AnalogPlus" control scheme. * @property {MyAvatar.SitStandModelType} userRecenterModel - Controls avatar leaning and recentering behavior. - * @property {number} isInSittingState - true if your avatar is sitting (avatar leaning is disabled, - * recenntering is enabled), false if it is standing (avatar leaning is enabled, and avatar recenters if it - * leans too far). If userRecenterModel == 2 (i.e., auto) the property value automatically updates as the - * user sits or stands, unless isSitStandStateLocked == true. Setting the property value overrides the - * current siting / standing state, which is updated when the user next sits or stands unless - * isSitStandStateLocked == true. + * @property {number} isInSittingState - true if, while in HMD, your avatar is determined to be sitting + * (avatar leaning is disabled, recenntering is enabled), false if your avatar is determined to be standing + * (avatar leaning is enabled, and avatar recenters if it leans too far). If userRecenterModel == 2 + * (i.e., auto) the property value automatically updates as the user sits or stands, unless + * isSitStandStateLocked == true. Setting the property value overrides the current siting / standing state, + * which is updated when the user next sits or stands unless isSitStandStateLocked == true. * @property {boolean} isSitStandStateLocked - true to lock the avatar sitting/standing state, i.e., use this * to disable automatically changing state. * @property {boolean} allowTeleporting - true if teleporting is enabled in the Interface settings, @@ -1890,6 +1890,14 @@ public: */ Q_INVOKABLE void endSit(const glm::vec3& position, const glm::quat& rotation); + /**jsdoc + * Gets whether the avatar is in a seated pose. The seated pose is set by calling the + * MyAvatar::beginSit method. + * @function MyAvatar.isSeated + * @returns {boolean} true if the avatar is in a seated pose. + */ + Q_INVOKABLE bool isSeated() { return _characterController.getSeated(); } + int getOverrideJointCount() const; bool getFlowActive() const; bool getNetworkGraphActive() const; From 07080f013892a3546bf2eb00c20b8afef6e85496 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Fri, 4 Oct 2019 13:47:20 -0700 Subject: [PATCH 2/2] Clarify jdocs --- interface/src/avatar/MyAvatar.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 127b0ae83c..a7ba639461 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -272,12 +272,13 @@ class MyAvatar : public Avatar { * the value.

* @property {number} analogPlusSprintSpeed - The sprint (run) speed of your avatar for the "AnalogPlus" control scheme. * @property {MyAvatar.SitStandModelType} userRecenterModel - Controls avatar leaning and recentering behavior. - * @property {number} isInSittingState - true if, while in HMD, your avatar is determined to be sitting - * (avatar leaning is disabled, recenntering is enabled), false if your avatar is determined to be standing - * (avatar leaning is enabled, and avatar recenters if it leans too far). If userRecenterModel == 2 - * (i.e., auto) the property value automatically updates as the user sits or stands, unless - * isSitStandStateLocked == true. Setting the property value overrides the current siting / standing state, - * which is updated when the user next sits or stands unless isSitStandStateLocked == true. + * @property {number} isInSittingState - true if the user wearing the HMD is determined to be sitting + * (avatar leaning is disabled, recenntering is enabled), false if the user wearing the HMD is + * determined to be standing (avatar leaning is enabled, and avatar recenters if it leans too far). + * If userRecenterModel == 2 (i.e., auto) the property value automatically updates as the user sits + * or stands, unless isSitStandStateLocked == true. Setting the property value overrides the current + * siting / standing state, which is updated when the user next sits or stands unless + * isSitStandStateLocked == true. * @property {boolean} isSitStandStateLocked - true to lock the avatar sitting/standing state, i.e., use this * to disable automatically changing state. * @property {boolean} allowTeleporting - true if teleporting is enabled in the Interface settings,