From d604f9adfb265b9311c2b66a2027256e9cd8b064 Mon Sep 17 00:00:00 2001
From: Simon Walton Note: In the examples, use "position
for use by QML.
+ *
* @property {boolean} shouldRenderLocally=true - If true
then your avatar is rendered for you in Interface,
* otherwise it is not rendered for you (but it is still rendered for other users).
* @property {Vec3} motorVelocity=Vec3.ZERO - The target velocity of your avatar to be achieved by a scripted motor.
@@ -90,29 +91,38 @@ class MyAvatar : public Avatar {
* @property {number} audioListenerModeCamera=1 - The audio listening position is at the camera. Read-only.
* @property {number} audioListenerModeCustom=2 - The audio listening position is at a the position specified by set by the
* customListenPosition
and customListenOrientation
property values. Read-only.
+ * @property {Vec3} customListenPosition=Vec3.ZERO - The listening position used when the audioListenerMode
+ * property value is audioListenerModeCustom
.
+ * @property {Quat} customListenOrientation=Quat.IDENTITY - The listening orientation used when the
+ * audioListenerMode
property value is audioListenerModeCustom
.
* @property {boolean} hasScriptedBlendshapes=false - Blendshapes will be transmitted over the network if set to true.
* @property {boolean} hasProceduralBlinkFaceMovement=true - procedural blinking will be turned on if set to true.
* @property {boolean} hasProceduralEyeFaceMovement=true - procedural eye movement will be turned on if set to true.
* @property {boolean} hasAudioEnabledFaceMovement=true - If set to true, voice audio will move the mouth Blendshapes while MyAvatar.hasScriptedBlendshapes is enabled.
- * @property {Vec3} customListenPosition=Vec3.ZERO - The listening position used when the audioListenerMode
- * property value is audioListenerModeCustom
.
- * @property {Quat} customListenOrientation=Quat.IDENTITY - The listening orientation used when the
- * audioListenerMode
property value is audioListenerModeCustom
.
+ * @property {number} rotationRecenterFilterLength
+ * @property {number} rotationThreshold
+ * @property {boolean} enableStepResetRotation
+ * @property {boolean} enableDrawAverageFacing
+ *
* @property {Vec3} leftHandPosition - The position of the left hand in avatar coordinates if it's being positioned by
* controllers, otherwise {@link Vec3(0)|Vec3.ZERO}. Read-only.
* @property {Vec3} rightHandPosition - The position of the right hand in avatar coordinates if it's being positioned by
* controllers, otherwise {@link Vec3(0)|Vec3.ZERO}. Read-only.
-
* @property {Vec3} leftHandTipPosition - The position 30cm offset from the left hand in avatar coordinates if it's being
* positioned by controllers, otherwise {@link Vec3(0)|Vec3.ZERO}. Read-only.
* @property {Vec3} rightHandTipPosition - The position 30cm offset from the right hand in avatar coordinates if it's being
* positioned by controllers, otherwise {@link Vec3(0)|Vec3.ZERO}. Read-only.
+ *
* @property {Pose} leftHandPose - The pose of the left hand as determined by the hand controllers. Read-only.
* @property {Pose} rightHandPose - The pose right hand position as determined by the hand controllers. Read-only.
* @property {Pose} leftHandTipPose - The pose of the left hand as determined by the hand controllers, with the position
* by 30cm. Read-only.
* @property {Pose} rightHandTipPose - The pose of the right hand as determined by the hand controllers, with the position
* by 30cm. Read-only.
+ *
+ * @property {number} energy
+ * @property {boolean} isAway
+ *
* @property {boolean} centerOfGravityModelEnabled=true - If true
then the avatar hips are placed according to the center of
* gravity model that balance the center of gravity over the base of support of the feet. Setting the value false
* will result in the default behaviour where the hips are placed under the head.
@@ -122,30 +132,38 @@ class MyAvatar : public Avatar {
* @property {boolean} collisionsEnabled - Set to true
to enable collisions for the avatar, false
* to disable collisions. May return true
even though the value was set false
because the
* zone may disallow collisionless avatars.
+ * @property {boolean} otherAvatarsCollisionsEnabled
* @property {boolean} characterControllerEnabled - Synonym of collisionsEnabled
.
* Deprecated: Use collisionsEnabled
instead.
* @property {boolean} useAdvancedMovementControls - Returns and sets the value of the Interface setting, Settings >
* Walking and teleporting. Note: Setting the value has no effect unless Interface is restarted.
* @property {boolean} showPlayArea - Returns and sets the value of the Interface setting, Settings > Show room boundaries
* while teleporting. Note: Setting the value has no effect unless Interface is restarted.
+ *
* @property {number} yawSpeed=75
* @property {number} pitchSpeed=50
+ *
* @property {boolean} hmdRollControlEnabled=true - If true
, the roll angle of your HMD turns your avatar
* while flying.
* @property {number} hmdRollControlDeadZone=8 - The amount of HMD roll, in degrees, required before your avatar turns if
* hmdRollControlEnabled
is enabled.
* @property {number} hmdRollControlRate If hmdRollControlEnabled is true, this value determines the maximum turn rate of
* your avatar when rolling your HMD in degrees per second.
+ *
* @property {number} userHeight=1.75 - The height of the user in sensor space.
* @property {number} userEyeHeight=1.65 - The estimated height of the user's eyes in sensor space. Read-only.
+ *
* @property {Uuid} SELF_ID - UUID representing "my avatar". Only use for local-only entities in situations
* where MyAvatar.sessionUUID is not available (e.g., if not connected to a domain). Note: Likely to be deprecated.
* Read-only.
+ *
* @property {number} walkSpeed
* @property {number} walkBackwardSpeed
* @property {number} sprintSpeed
* @property {number} isInSittingState
- * @property {number} userRecenterModel
+ * @property {MyAvatar.SitStandModelType} userRecenterModel
+ * @property {boolean} isSitStandStateLocked
+ * @property {boolean} allowTeleporting
*
* @property {Vec3} skeletonOffset - Can be used to apply a translation offset between the avatar's position and the
* registration point of the 3D model.
@@ -160,6 +178,7 @@ class MyAvatar : public Avatar {
* sometimes called "elevation".
* @property {number} bodyRoll - The rotation about an axis running from the chest to the back of the avatar. Roll is
* sometimes called "bank".
+ *
* @property {Quat} orientation
* @property {Quat} headOrientation - The orientation of the avatar's head.
* @property {number} headPitch - The rotation about an axis running from ear to ear of the avatar's head. Pitch is
@@ -168,18 +187,24 @@ class MyAvatar : public Avatar {
* head. Yaw is sometimes called "heading".
* @property {number} headRoll - The rotation about an axis running from the nose to the back of the avatar's head. Roll is
* sometimes called "bank".
+ *
* @property {Vec3} velocity
* @property {Vec3} angularVelocity
+ *
* @property {number} audioLoudness
* @property {number} audioAverageLoudness
+ *
* @property {string} displayName
* @property {string} sessionDisplayName - Sanitized, defaulted version displayName that is defined by the AvatarMixer
* rather than by Interface clients. The result is unique among all avatars present at the time.
* @property {boolean} lookAtSnappingEnabled
* @property {string} skeletonModelURL
* @property {AttachmentData[]} attachmentData
+ *
* @property {string[]} jointNames - The list of joints in the current avatar model. Read-only.
+ *
* @property {Uuid} sessionUUID Read-only.
+ *
* @property {Mat4} sensorToWorldMatrix Read-only.
* @property {Mat4} controllerLeftHandMatrix Read-only.
* @property {Mat4} controllerRightHandMatrix Read-only.
@@ -196,11 +221,11 @@ class MyAvatar : public Avatar {
Q_PROPERTY(QString motorMode READ getScriptedMotorMode WRITE setScriptedMotorMode)
Q_PROPERTY(QString collisionSoundURL READ getCollisionSoundURL WRITE setCollisionSoundURL)
Q_PROPERTY(AudioListenerMode audioListenerMode READ getAudioListenerMode WRITE setAudioListenerMode)
- Q_PROPERTY(glm::vec3 customListenPosition READ getCustomListenPosition WRITE setCustomListenPosition)
- Q_PROPERTY(glm::quat customListenOrientation READ getCustomListenOrientation WRITE setCustomListenOrientation)
Q_PROPERTY(AudioListenerMode audioListenerModeHead READ getAudioListenerModeHead)
Q_PROPERTY(AudioListenerMode audioListenerModeCamera READ getAudioListenerModeCamera)
Q_PROPERTY(AudioListenerMode audioListenerModeCustom READ getAudioListenerModeCustom)
+ Q_PROPERTY(glm::vec3 customListenPosition READ getCustomListenPosition WRITE setCustomListenPosition)
+ Q_PROPERTY(glm::quat customListenOrientation READ getCustomListenOrientation WRITE setCustomListenOrientation)
Q_PROPERTY(bool hasScriptedBlendshapes READ getHasScriptedBlendshapes WRITE setHasScriptedBlendshapes)
Q_PROPERTY(bool hasProceduralBlinkFaceMovement READ getHasProceduralBlinkFaceMovement WRITE setHasProceduralBlinkFaceMovement)
Q_PROPERTY(bool hasProceduralEyeFaceMovement READ getHasProceduralEyeFaceMovement WRITE setHasProceduralEyeFaceMovement)
@@ -277,6 +302,9 @@ public:
};
Q_ENUM(DriveKeys)
+ /**jsdoc
+ * @typedef {number} MyAvatar.SitStandModelType
+ */
enum SitStandModelType {
ForceSit = 0,
ForceStand,
@@ -491,6 +519,9 @@ public:
// adding one of the other handlers. While any handler may change a value in animStateDictionaryIn (or supply different values in animStateDictionaryOut)
// a handler must not remove properties from animStateDictionaryIn, nor change property values that it does not intend to change.
// It is not specified in what order multiple handlers are called.
+ /**jsdoc
+ * @function MyAvatar.addAnimationStateHandler
+ */
Q_INVOKABLE QScriptValue addAnimationStateHandler(QScriptValue handler, QScriptValue propertiesList) { return _skeletonModel->getRig().addAnimationStateHandler(handler, propertiesList); }
/**jsdoc
@@ -530,7 +561,7 @@ public:
*/
Q_INVOKABLE void setHmdAvatarAlignmentType(const QString& hand);
/**jsdoc
- * @function MyAvatar.setHmdAvatarAlignmentType
+ * @function MyAvatar.getHmdAvatarAlignmentType
* @returns {string}
*/
Q_INVOKABLE QString getHmdAvatarAlignmentType() const;
@@ -649,7 +680,7 @@ public:
/**jsdoc
* Recenter the avatar in the horizontal direction, if {@link MyAvatar|MyAvatar.hmdLeanRecenterEnabled}
is
* false
.
- * @ function MyAvatar.triggerHorizontalRecenter
+ * @function MyAvatar.triggerHorizontalRecenter
*/
Q_INVOKABLE void triggerHorizontalRecenter();
@@ -935,7 +966,7 @@ public:
/**jsdoc
* Function returns list of avatar entities
- * @function MyAvatar.getAvatarEntitiesVariant()
+ * @function MyAvatar.getAvatarEntitiesVariant
* @returns {object[]}
*/
Q_INVOKABLE QVariantList getAvatarEntitiesVariant();
@@ -1244,7 +1275,6 @@ public slots:
* @param {boolean} [shouldFaceLocation=false] - Set to true
to position the avatar a short distance away from
* the new position and orientate the avatar to face the position.
*/
-
void goToFeetLocation(const glm::vec3& newPosition,
bool hasOrientation, const glm::quat& newOrientation,
bool shouldFaceLocation);
@@ -1382,8 +1412,20 @@ public slots:
*/
bool getEnableMeshVisible() const override;
+ /**jsdoc
+ * @function MyAvatar.storeAvatarEntityDataPayload
+ */
void storeAvatarEntityDataPayload(const QUuid& entityID, const QByteArray& payload) override;
+
+ /**jsdoc
+ * @function MyAvatar.clearAvatarEntity
+ * @param {Uuid} entityID
+ * @param {boolean} requiresRemovalFromTree
+ */
void clearAvatarEntity(const QUuid& entityID, bool requiresRemovalFromTree = true) override;
+ /**jsdoc
+ * @function MyAvatar.sanitizeAvatarEntityProperties
+ */
void sanitizeAvatarEntityProperties(EntityItemProperties& properties) const;
/**jsdoc
@@ -1489,11 +1531,11 @@ signals:
void collisionsEnabledChanged(bool enabled);
/**jsdoc
- * Triggered when collisions with other avatars enabled or disabled
- * @function MyAvatar.otherAvatarsCollisionsEnabledChanged
- * @param {boolean} enabled
- * @returns {Signal}
- */
+ * Triggered when collisions with other avatars enabled or disabled
+ * @function MyAvatar.otherAvatarsCollisionsEnabledChanged
+ * @param {boolean} enabled
+ * @returns {Signal}
+ */
void otherAvatarsCollisionsEnabledChanged(bool enabled);
/**jsdoc
diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h
index 06942a13d8..7ebb8cad01 100644
--- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h
+++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h
@@ -499,6 +499,9 @@ public:
void tearDownGrabs();
signals:
+ /**jsdoc
+ * @function MyAvatar.targetScaleChanged
+ */
void targetScaleChanged(float targetScale);
public slots:
@@ -541,6 +544,9 @@ public slots:
*/
glm::quat getRightPalmRotation() const;
+ /**jsdoc
+ * @function MyAvatar.setModelURLFinished
+ */
// hooked up to Model::setURLFinished signal
void setModelURLFinished(bool success);
From f58a5db0b0931ce0244007a748ed545d51196194 Mon Sep 17 00:00:00 2001
From: David Rowe Avatar
API is used to manipulate scriptable avatars on the domain. This API is a subset of the
* {@link MyAvatar} API.
*
- * Avatar
" instead of "MyAvatar
".
+ * Get the names of all the joints in the current avatar.
+ * @function Avatar.getJointNames
+ * @returns {string[]} The joint names.
+ * @example
+ * Get the joint index for a named joint. The joint index value is the position of the joint in the array returned by
+ * {@link Avatar.getJointNames}.
+ * @function Avatar.getJointIndex
+ * @param {string} name - The name of the joint.
+ * @returns {number} The index of the joint.
+ * @example
+ * ####### Also need to resolve with MyAvatar.
* Potentially Very Expensive. Do not use.
* @function Avatar.getAvatarEntityData
* @returns {object}
@@ -200,13 +147,15 @@ public:
Q_INVOKABLE AvatarEntityMap getAvatarEntityData() const override;
/**jsdoc
- * @function MyAvatar.setAvatarEntityData
- * @param {object} avatarEntityData
- */
+ * ####### TODO: If this override changes the function use @override and do JSDoc here, otherwise @comment that uses base class's JSDoc.
+ * @function Avatar.setAvatarEntityData
+ * @param {object} avatarEntityData
+ */
Q_INVOKABLE void setAvatarEntityData(const AvatarEntityMap& avatarEntityData) override;
/**jsdoc
- * @function MyAvatar.updateAvatarEntity
+ * ####### TODO: If this override changes the function use @override and do JSDoc here, otherwise @comment that uses base class's JSDoc.
+ * @function Avatar.updateAvatarEntity
* @param {Uuid} entityID
* @param {string} entityData
*/
@@ -214,12 +163,12 @@ public:
public slots:
/**jsdoc
- * @function MyAvatar.update
+ * @function Avatar.update
*/
void update(float deltatime);
/**jsdoc
- * @function MyAvatar.setJointMappingsFromNetworkReply
+ * @function Avatar.setJointMappingsFromNetworkReply
*/
void setJointMappingsFromNetworkReply();
diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h
index 4e75c93403..d689d2f215 100755
--- a/interface/src/avatar/MyAvatar.h
+++ b/interface/src/avatar/MyAvatar.h
@@ -68,6 +68,46 @@ class MyAvatar : public Avatar {
* @hifi-client-entity
* @hifi-avatar
*
+ * @comment IMPORTANT: This group of properties is copied from AvatarData.h; they should NOT be edited here.
+ * @property {Vec3} position
+ * @property {number} scale - Returns the clamped scale of the avatar.
+ * @property {number} density Read-only.
+ * @property {Vec3} handPosition
+ * @property {number} bodyYaw - The rotation left or right about an axis running from the head to the feet of the avatar.
+ * Yaw is sometimes called "heading".
+ * @property {number} bodyPitch - The rotation about an axis running from shoulder to shoulder of the avatar. Pitch is
+ * sometimes called "elevation".
+ * @property {number} bodyRoll - The rotation about an axis running from the chest to the back of the avatar. Roll is
+ * sometimes called "bank".
+ * @property {Quat} orientation
+ * @property {Quat} headOrientation - The orientation of the avatar's head.
+ * @property {number} headPitch - The rotation about an axis running from ear to ear of the avatar's head. Pitch is
+ * sometimes called "elevation".
+ * @property {number} headYaw - The rotation left or right about an axis running from the base to the crown of the avatar's
+ * head. Yaw is sometimes called "heading".
+ * @property {number} headRoll - The rotation about an axis running from the nose to the back of the avatar's head. Roll is
+ * sometimes called "bank".
+ * @property {Vec3} velocity
+ * @property {Vec3} angularVelocity
+ * @property {number} audioLoudness
+ * @property {number} audioAverageLoudness
+ * @property {string} displayName
+ * @property {string} sessionDisplayName - Sanitized, defaulted version displayName that is defined by the AvatarMixer
+ * rather than by Interface clients. The result is unique among all avatars present at the time.
+ * @property {boolean} lookAtSnappingEnabled
+ * @property {string} skeletonModelURL
+ * @property {AttachmentData[]} attachmentData
+ * @property {string[]} jointNames - The list of joints in the current avatar model. Read-only.
+ * @property {Uuid} sessionUUID Read-only.
+ * @property {Mat4} sensorToWorldMatrix Read-only.
+ * @property {Mat4} controllerLeftHandMatrix Read-only.
+ * @property {Mat4} controllerRightHandMatrix Read-only.
+ * @property {number} sensorToWorldScale Read-only.
+ *
+ * @comment IMPORTANT: This group of properties is copied from Avatar.h; they should NOT be edited here.
+ * @property {Vec3} skeletonOffset - Can be used to apply a translation offset between the avatar's position and the
+ * registration point of the 3D model.
+ *
* @property {Vec3} qmlPosition - A synonym for position
for use by QML.
*
* @property {boolean} shouldRenderLocally=true - If true
then your avatar is rendered for you in Interface,
@@ -165,50 +205,60 @@ class MyAvatar : public Avatar {
* @property {boolean} isSitStandStateLocked
* @property {boolean} allowTeleporting
*
- * @property {Vec3} skeletonOffset - Can be used to apply a translation offset between the avatar's position and the
- * registration point of the 3D model.
- *
- * @property {Vec3} position
- * @property {number} scale - Returns the clamped scale of the avatar.
- * @property {number} density Read-only.
- * @property {Vec3} handPosition
- * @property {number} bodyYaw - The rotation left or right about an axis running from the head to the feet of the avatar.
- * Yaw is sometimes called "heading".
- * @property {number} bodyPitch - The rotation about an axis running from shoulder to shoulder of the avatar. Pitch is
- * sometimes called "elevation".
- * @property {number} bodyRoll - The rotation about an axis running from the chest to the back of the avatar. Roll is
- * sometimes called "bank".
- *
- * @property {Quat} orientation
- * @property {Quat} headOrientation - The orientation of the avatar's head.
- * @property {number} headPitch - The rotation about an axis running from ear to ear of the avatar's head. Pitch is
- * sometimes called "elevation".
- * @property {number} headYaw - The rotation left or right about an axis running from the base to the crown of the avatar's
- * head. Yaw is sometimes called "heading".
- * @property {number} headRoll - The rotation about an axis running from the nose to the back of the avatar's head. Roll is
- * sometimes called "bank".
- *
- * @property {Vec3} velocity
- * @property {Vec3} angularVelocity
- *
- * @property {number} audioLoudness
- * @property {number} audioAverageLoudness
- *
- * @property {string} displayName
- * @property {string} sessionDisplayName - Sanitized, defaulted version displayName that is defined by the AvatarMixer
- * rather than by Interface clients. The result is unique among all avatars present at the time.
- * @property {boolean} lookAtSnappingEnabled
- * @property {string} skeletonModelURL
- * @property {AttachmentData[]} attachmentData
- *
- * @property {string[]} jointNames - The list of joints in the current avatar model. Read-only.
- *
- * @property {Uuid} sessionUUID Read-only.
- *
- * @property {Mat4} sensorToWorldMatrix Read-only.
- * @property {Mat4} controllerLeftHandMatrix Read-only.
- * @property {Mat4} controllerRightHandMatrix Read-only.
- * @property {number} sensorToWorldScale Read-only.
+ * @borrows Avatar.getDomainMinScale as getDomainMinScale
+ * @borrows Avatar.getDomainMaxScale as getDomainMaxScale
+ * @borrows Avatar.getEyeHeight as getEyeHeight
+ * @borrows Avatar.getHeight as getHeight
+ * @borrows Avatar.setHandState as setHandState
+ * @borrows Avatar.getHandState as getHandState
+ * @borrows Avatar.setRawJointData as setRawJointData
+ * @borrows Avatar.setJointData as setJointData
+ * @borrows Avatar.setJointRotation as setJointRotation
+ * @borrows Avatar.setJointTranslation as setJointTranslation
+ * @borrows Avatar.clearJointData as clearJointData
+ * @borrows Avatar.isJointDataValid as isJointDataValid
+ * @borrows Avatar.getJointRotation as getJointRotation
+ * @borrows Avatar.getJointTranslation as getJointTranslation
+ * @borrows Avatar.getJointRotations as getJointRotations
+ * @borrows Avatar.getJointTranslations as getJointTranslations
+ * @borrows Avatar.setJointRotations as setJointRotations
+ * @borrows Avatar.setJointTranslations as setJointTranslations
+ * @borrows Avatar.clearJointsData as clearJointsData
+ * @borrows Avatar.getJointIndex as getJointIndex
+ * @borrows Avatar.getJointNames as getJointNames
+ * @borrows Avatar.setBlendshape as setBlendshape
+ * @borrows Avatar.getAttachmentsVariant as getAttachmentsVariant
+ * @borrows Avatar.setAttachmentsVariant as setAttachmentsVariant
+ * @borrows Avatar.updateAvatarEntity as updateAvatarEntity
+ * @borrows Avatar.clearAvatarEntity as clearAvatarEntity
+ * @borrows Avatar.setForceFaceTrackerConnected as setForceFaceTrackerConnected
+ * @borrows Avatar.getAttachmentData as getAttachmentData
+ * @borrows Avatar.setAttachmentData as setAttachmentData
+ * @borrows Avatar.attach as attach
+ * @borrows Avatar.detachOne as detachOne
+ * @borrows Avatar.detachAll as detachAll
+ * @borrows Avatar.getAvatarEntityData as getAvatarEntityData
+ * @borrows Avatar.setAvatarEntityData as setAvatarEntityData
+ * @borrows Avatar.getSensorToWorldMatrix as getSensorToWorldMatrix
+ * @borrows Avatar.getSensorToWorldScale as getSensorToWorldScale
+ * @borrows Avatar.getControllerLeftHandMatrix as getControllerLeftHandMatrix
+ * @borrows Avatar.getControllerRightHandMatrix as getControllerRightHandMatrix
+ * @borrows Avatar.getDataRate as getDataRate
+ * @borrows Avatar.getUpdateRate as getUpdateRate
+ * @borrows Avatar.displayNameChanged as displayNameChanged
+ * @borrows Avatar.sessionDisplayNameChanged as sessionDisplayNameChanged
+ * @borrows Avatar.skeletonModelURLChanged as skeletonModelURLChanged
+ * @borrows Avatar.lookAtSnappingChanged as lookAtSnappingChanged
+ * @borrows Avatar.sessionUUIDChanged as sessionUUIDChanged
+ * @borrows Avatar.sendAvatarDataPacket as sendAvatarDataPacket
+ * @borrows Avatar.sendIdentityPacket as sendIdentityPacket
+ * @borrows Avatar.setSessionUUID as setSessionUUID
+ * @borrows Avatar.getAbsoluteJointRotationInObjectFrame as getAbsoluteJointRotationInObjectFrame
+ * @borrows Avatar.getAbsoluteJointTranslationInObjectFrame as getAbsoluteJointTranslationInObjectFrame
+ * @borrows Avatar.setAbsoluteJointRotationInObjectFrame as setAbsoluteJointRotationInObjectFrame
+ * @borrows Avatar.setAbsoluteJointTranslationInObjectFrame as setAbsoluteJointTranslationInObjectFrame
+ * @borrows Avatar.getTargetScale as getTargetScale
+ * @borrows Avatar.resetLastSent as resetLastSent
*/
// FIXME: `glm::vec3 position` is not accessible from QML, so this exposes position in a QML-native type
Q_PROPERTY(QVector3D qmlPosition READ getQmlPosition)
@@ -1314,7 +1364,7 @@ public slots:
/**jsdoc
* @function MyAvatar.restrictScaleFromDomainSettings
- * @param {objecct} domainSettingsObject
+ * @param {object} domainSettingsObject
*/
void restrictScaleFromDomainSettings(const QJsonObject& domainSettingsObject);
@@ -1345,6 +1395,7 @@ public slots:
/**jsdoc
+ * ####### Why Q_INVOKABLE?
* @function MyAvatar.updateMotionBehaviorFromMenu
*/
Q_INVOKABLE void updateMotionBehaviorFromMenu();
@@ -1413,16 +1464,19 @@ public slots:
bool getEnableMeshVisible() const override;
/**jsdoc
+ * ####### TODO; Should this really be exposed in the API?
* @function MyAvatar.storeAvatarEntityDataPayload
*/
void storeAvatarEntityDataPayload(const QUuid& entityID, const QByteArray& payload) override;
/**jsdoc
+ * ####### Does override change functionality? If so, document here and don't borrow; if not, borrow and don't document here.
* @function MyAvatar.clearAvatarEntity
* @param {Uuid} entityID
- * @param {boolean} requiresRemovalFromTree
+ * @param {boolean} [requiresRemovalFromTree]
*/
void clearAvatarEntity(const QUuid& entityID, bool requiresRemovalFromTree = true) override;
+
/**jsdoc
* @function MyAvatar.sanitizeAvatarEntityProperties
*/
diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h
index 7ebb8cad01..1aa6829160 100644
--- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h
+++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h
@@ -127,7 +127,12 @@ private:
class Avatar : public AvatarData, public scriptable::ModelProvider, public MetaModelPayload {
Q_OBJECT
- // This property has JSDoc in MyAvatar.h.
+ /*jsdoc
+ * @comment IMPORTANT: The JSDoc for the following properties should be copied to MyAvatar.h.
+ *
+ * @property {Vec3} skeletonOffset - Can be used to apply a translation offset between the avatar's position and the
+ * registration point of the 3D model.
+ */
Q_PROPERTY(glm::vec3 skeletonOffset READ getSkeletonOffset WRITE setSkeletonOffset)
public:
diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h
index 63396a59ac..7a4d235565 100755
--- a/libraries/avatars/src/AvatarData.h
+++ b/libraries/avatars/src/AvatarData.h
@@ -411,7 +411,43 @@ class ClientTraitsHandler;
class AvatarData : public QObject, public SpatiallyNestable {
Q_OBJECT
- // The following properties have JSDoc in MyAvatar.h and ScriptableAvatar.h
+ // IMPORTANT: The JSDoc for the following properties should be copied to MyAvatar.h and ScriptableAvatar.h.
+ /*
+ * @property {Vec3} position
+ * @property {number} scale - Returns the clamped scale of the avatar.
+ * @property {number} density Read-only.
+ * @property {Vec3} handPosition
+ * @property {number} bodyYaw - The rotation left or right about an axis running from the head to the feet of the avatar.
+ * Yaw is sometimes called "heading".
+ * @property {number} bodyPitch - The rotation about an axis running from shoulder to shoulder of the avatar. Pitch is
+ * sometimes called "elevation".
+ * @property {number} bodyRoll - The rotation about an axis running from the chest to the back of the avatar. Roll is
+ * sometimes called "bank".
+ * @property {Quat} orientation
+ * @property {Quat} headOrientation - The orientation of the avatar's head.
+ * @property {number} headPitch - The rotation about an axis running from ear to ear of the avatar's head. Pitch is
+ * sometimes called "elevation".
+ * @property {number} headYaw - The rotation left or right about an axis running from the base to the crown of the avatar's
+ * head. Yaw is sometimes called "heading".
+ * @property {number} headRoll - The rotation about an axis running from the nose to the back of the avatar's head. Roll is
+ * sometimes called "bank".
+ * @property {Vec3} velocity
+ * @property {Vec3} angularVelocity
+ * @property {number} audioLoudness
+ * @property {number} audioAverageLoudness
+ * @property {string} displayName
+ * @property {string} sessionDisplayName - Sanitized, defaulted version displayName that is defined by the AvatarMixer
+ * rather than by Interface clients. The result is unique among all avatars present at the time.
+ * @property {boolean} lookAtSnappingEnabled
+ * @property {string} skeletonModelURL
+ * @property {AttachmentData[]} attachmentData
+ * @property {string[]} jointNames - The list of joints in the current avatar model. Read-only.
+ * @property {Uuid} sessionUUID Read-only.
+ * @property {Mat4} sensorToWorldMatrix Read-only.
+ * @property {Mat4} controllerLeftHandMatrix Read-only.
+ * @property {Mat4} controllerRightHandMatrix Read-only.
+ * @property {number} sensorToWorldScale Read-only.
+ */
Q_PROPERTY(glm::vec3 position READ getWorldPosition WRITE setPositionViaScript)
Q_PROPERTY(float scale READ getDomainLimitedScale WRITE setTargetScale)
Q_PROPERTY(float density READ getDensity)
@@ -567,7 +603,7 @@ public:
/**jsdoc
* Returns the minimum scale allowed for this avatar in the current domain.
* This value can change as the user changes avatars or when changing domains.
- * @function MyAvatar.getDomainMinScale
+ * @function Avatar.getDomainMinScale
* @returns {number} minimum scale allowed for this avatar in the current domain.
*/
Q_INVOKABLE float getDomainMinScale() const;
@@ -575,7 +611,7 @@ public:
/**jsdoc
* Returns the maximum scale allowed for this avatar in the current domain.
* This value can change as the user changes avatars or when changing domains.
- * @function MyAvatar.getDomainMaxScale
+ * @function Avatar.getDomainMaxScale
* @returns {number} maximum scale allowed for this avatar in the current domain.
*/
Q_INVOKABLE float getDomainMaxScale() const;
@@ -591,7 +627,7 @@ public:
/**jsdoc
* Provides read only access to the current eye height of the avatar.
* This height is only an estimate and might be incorrect for avatars that are missing standard joints.
- * @function MyAvatar.getEyeHeight
+ * @function Avatar.getEyeHeight
* @returns {number} Eye height of avatar in meters.
*/
Q_INVOKABLE virtual float getEyeHeight() const { return _targetScale * getUnscaledEyeHeight(); }
@@ -599,7 +635,7 @@ public:
/**jsdoc
* Provides read only access to the current height of the avatar.
* This height is only an estimate and might be incorrect for avatars that are missing standard joints.
- * @function MyAvatar.getHeight
+ * @function Avatar.getHeight
* @returns {number} Height of avatar in meters.
*/
Q_INVOKABLE virtual float getHeight() const;
@@ -610,13 +646,13 @@ public:
void setDomainMaximumHeight(float domainMaximumHeight);
/**jsdoc
- * @function MyAvatar.setHandState
+ * @function Avatar.setHandState
* @param {string} state
*/
Q_INVOKABLE void setHandState(char s) { _handState = s; }
/**jsdoc
- * @function MyAvatar.getHandState
+ * @function Avatar.getHandState
* @returns {string}
*/
Q_INVOKABLE char getHandState() const { return _handState; }
@@ -624,7 +660,7 @@ public:
const QVector
Note: This is slightly faster than the function variation that specifies the joint name.
- * @function MyAvatar.clearJointData + * @function Avatar.clearJointData * @param {number} index - The index of the joint. */ Q_INVOKABLE virtual void clearJointData(int index); /**jsdoc - * @function MyAvatar.isJointDataValid + * @function Avatar.isJointDataValid * @param {number} index * @returns {boolean} */ @@ -702,7 +740,7 @@ public: /**jsdoc * Get the rotation of a joint relative to its parent. For information on the joint hierarchy used, see * Avatar Standards. - * @function MyAvatar.getJointRotation + * @function Avatar.getJointRotation * @param {number} index - The index of the joint. * @returns {Quat} The rotation of the joint relative to its parent. */ @@ -711,7 +749,7 @@ public: /**jsdoc * Get the translation of a joint relative to its parent. For information on the joint hierarchy used, see * Avatar Standards. - * @function MyAvatar.getJointTranslation + * @function Avatar.getJointTranslation * @param {number} index - The index of the joint. * @returns {Vec3} The translation of the joint relative to its parent. */ @@ -724,7 +762,7 @@ public: * the avatar's hand and head would still do inverse kinematics properly. However, as soon as you start to manipulate * joints in the inverse kinematics chain, the inverse kinematics might not function as you expect. For example, if you set * the rotation of the elbow, the hand inverse kinematics position won't end up in the right place. - * @function MyAvatar.setJointData + * @function Avatar.setJointData * @param {string} name - The name of the joint. * @param {Quat} rotation - The rotation of the joint relative to its parent. * @param {Vec3} translation - The translation of the joint relative to its parent. @@ -738,7 +776,7 @@ public: * the avatar's hand and head would still do inverse kinematics properly. However, as soon as you start to manipulate * joints in the inverse kinematics chain, the inverse kinematics might not function as you expect. For example, if you set * the rotation of the elbow, the hand inverse kinematics position won't end up in the right place. - * @function MyAvatar.setJointRotation + * @function Avatar.setJointRotation * @param {string} name - The name of the joint. * @param {Quat} rotation - The rotation of the joint relative to its parent. * @exampleNote: This is slightly slower than the function variation that specifies the joint index.
- * @function MyAvatar.clearJointData + * @function Avatar.clearJointData * @param {string} name - The name of the joint. * @exampleattachmentData
to null
.
- * @function MyAvatar.setAttachmentData
+ * @function Avatar.setAttachmentData
* @param {AttachmentData[]} attachmentData - The attachment data defining the models to have attached to your avatar. Use
* null
to remove all attachments.
* @example Note: Attached models are models only; they are not entities and can not be manipulated using the {@link Entities} API. * Nor can you use this function to attach an entity (such as a sphere or a box) to your avatar.
- * @function MyAvatar.attach + * @function Avatar.attach * @param {string} modelURL - The URL of the model to attach. Models can be .FBX or .OBJ format. * @param {string} [jointName=""] - The name of the avatar joint (see {@link MyAvatar.getJointNames} or {@link Avatar.getJointNames}) to attach the model * to. @@ -1089,6 +1152,8 @@ public: * attachment.rotation, * attachment.scale, * attachment.isSoft); + * + * // Note: If using from the Avatar API, replace "MyAvatar" with "Avatar". */ Q_INVOKABLE virtual void attach(const QString& modelURL, const QString& jointName = QString(), const glm::vec3& translation = glm::vec3(), const glm::quat& rotation = glm::quat(), @@ -1097,7 +1162,7 @@ public: /**jsdoc * Detach the most recently attached instance of a particular model from either a specific joint or any joint. - * @function MyAvatar.detachOne + * @function Avatar.detachOne * @param {string} modelURL - The URL of the model to detach. * @param {string} [jointName=""] - The name of the joint to detach the model from. If""
, then the most
* recently attached model is removed from which ever joint it was attached to.
@@ -1106,7 +1171,7 @@ public:
/**jsdoc
* Detach all instances of a particular model from either a specific joint or all joints.
- * @function MyAvatar.detachAll
+ * @function Avatar.detachAll
* @param {string} modelURL - The URL of the model to detach.
* @param {string} [jointName=""] - The name of the joint to detach the model from. If ""
, then the model is
* detached from all joints.
@@ -1136,13 +1201,13 @@ public:
AABox getDefaultBubbleBox() const;
/**jsdoc
- * @function MyAvatar.getAvatarEntityData
+ * @function Avatar.getAvatarEntityData
* @returns {object}
*/
Q_INVOKABLE virtual AvatarEntityMap getAvatarEntityData() const;
/**jsdoc
- * @function MyAvatar.setAvatarEntityData
+ * @function Avatar.setAvatarEntityData
* @param {object} avatarEntityData
*/
Q_INVOKABLE virtual void setAvatarEntityData(const AvatarEntityMap& avatarEntityData);
@@ -1151,28 +1216,28 @@ public:
AvatarEntityIDs getAndClearRecentlyRemovedIDs();
/**jsdoc
- * @function MyAvatar.getSensorToWorldMatrix
+ * @function Avatar.getSensorToWorldMatrix
* @returns {Mat4}
*/
// thread safe
Q_INVOKABLE glm::mat4 getSensorToWorldMatrix() const;
/**jsdoc
- * @function MyAvatar.getSensorToWorldScale
+ * @function Avatar.getSensorToWorldScale
* @returns {number}
*/
// thread safe
Q_INVOKABLE float getSensorToWorldScale() const;
/**jsdoc
- * @function MyAvatar.getControllerLeftHandMatrix
+ * @function Avatar.getControllerLeftHandMatrix
* @returns {Mat4}
*/
// thread safe
Q_INVOKABLE glm::mat4 getControllerLeftHandMatrix() const;
/**jsdoc
- * @function MyAvatar.getControllerRightHandMatrix
+ * @function Avatar.getControllerRightHandMatrix
* @returns {Mat4}
*/
// thread safe
@@ -1180,14 +1245,14 @@ public:
/**jsdoc
- * @function MyAvatar.getDataRate
+ * @function Avatar.getDataRate
* @param {string} [rateName=""]
* @returns {number}
*/
Q_INVOKABLE float getDataRate(const QString& rateName = QString("")) const;
/**jsdoc
- * @function MyAvatar.getUpdateRate
+ * @function Avatar.getUpdateRate
* @param {string} [rateName=""]
* @returns {number}
*/
@@ -1235,32 +1300,32 @@ public:
signals:
/**jsdoc
- * @function MyAvatar.displayNameChanged
+ * @function Avatar.displayNameChanged
* @returns {Signal}
*/
void displayNameChanged();
/**jsdoc
- * @function MyAvatar.sessionDisplayNameChanged
+ * @function Avatar.sessionDisplayNameChanged
* @returns {Signal}
*/
void sessionDisplayNameChanged();
/**jsdoc
- * @function MyAvatar.skeletonModelURLChanged
+ * @function Avatar.skeletonModelURLChanged
* @returns {Signal}
*/
void skeletonModelURLChanged();
/**jsdoc
- * @function MyAvatar.lookAtSnappingChanged
+ * @function Avatar.lookAtSnappingChanged
* @param {boolean} enabled
* @returns {Signal}
*/
void lookAtSnappingChanged(bool enabled);
/**jsdoc
- * @function MyAvatar.sessionUUIDChanged
+ * @function Avatar.sessionUUIDChanged
* @returns {Signal}
*/
void sessionUUIDChanged();
@@ -1268,18 +1333,18 @@ signals:
public slots:
/**jsdoc
- * @function MyAvatar.sendAvatarDataPacket
+ * @function Avatar.sendAvatarDataPacket
* @param {boolean} [sendAll=false]
*/
virtual int sendAvatarDataPacket(bool sendAll = false);
/**jsdoc
- * @function MyAvatar.sendIdentityPacket
+ * @function Avatar.sendIdentityPacket
*/
int sendIdentityPacket();
/**jsdoc
- * @function MyAvatar.setSessionUUID
+ * @function Avatar.setSessionUUID
* @param {Uuid} sessionUUID
*/
virtual void setSessionUUID(const QUuid& sessionUUID) {
@@ -1294,21 +1359,21 @@ public slots:
}
/**jsdoc
- * @function MyAvatar.getAbsoluteJointRotationInObjectFrame
+ * @function Avatar.getAbsoluteJointRotationInObjectFrame
* @param {number} index
* @returns {Quat}
*/
virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const override;
/**jsdoc
- * @function MyAvatar.getAbsoluteJointTranslationInObjectFrame
+ * @function Avatar.getAbsoluteJointTranslationInObjectFrame
* @param {number} index
* @returns {Vec3}
*/
virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const override;
/**jsdoc
- * @function MyAvatar.setAbsoluteJointRotationInObjectFrame
+ * @function Avatar.setAbsoluteJointRotationInObjectFrame
* @param {number} index
* @param {Quat} rotation
* @returns {boolean}
@@ -1316,7 +1381,7 @@ public slots:
virtual bool setAbsoluteJointRotationInObjectFrame(int index, const glm::quat& rotation) override { return false; }
/**jsdoc
- * @function MyAvatar.setAbsoluteJointTranslationInObjectFrame
+ * @function Avatar.setAbsoluteJointTranslationInObjectFrame
* @param {number} index
* @param {Vec3} translation
* @returns {boolean}
@@ -1324,13 +1389,13 @@ public slots:
virtual bool setAbsoluteJointTranslationInObjectFrame(int index, const glm::vec3& translation) override { return false; }
/**jsdoc
- * @function MyAvatar.getTargetScale
+ * @function Avatar.getTargetScale
* @returns {number}
*/
float getTargetScale() const { return _targetScale; } // why is this a slot?
/**jsdoc
- * @function MyAvatar.resetLastSent
+ * @function Avatar.resetLastSent
*/
void resetLastSent() { _lastToByteArray = 0; }
From 01119a5b5d980be426bcb20bb773d2be6591ed9e Mon Sep 17 00:00:00 2001
From: David Rowe Agent
API enables an assignment client to emulate an avatar. In particular, setting isAvatar =
+ * true
connects the assignment client to the avatar and audio mixers and enables the {@link Avatar} API to be used.
+ *
* @namespace Agent
*
* @hifi-assignment-client
*
- * @property {boolean} isAvatar
- * @property {boolean} isPlayingAvatarSound Read-only.
- * @property {boolean} isListeningToAudioStream
- * @property {boolean} isNoiseGateEnabled
- * @property {number} lastReceivedAudioLoudness Read-only.
- * @property {Uuid} sessionUUID Read-only.
+ * @property {boolean} isAvatar - true
if the assignment client script is emulating an avatar, otherwise
+ * false
.
+ * @property {boolean} isPlayingAvatarSound - true
if the script has a sound to play, otherwise false
.
+ * Sounds are played when isAvatar
is true
, from the position and with the orientation of the
+ * scripted avatar's head.Read-only.
+ * @property {boolean} isListeningToAudioStream - true
if the agent is "listening" to the audio stream from the
+ * domain, otherwise false
.
+ * @property {boolean} isNoiseGateEnabled - true
if the noise gate is enabled, otherwise false
. When
+ * enabled, the input audio stream is blocked (fully attenuated) if it falls below an adaptive threshold.
+ * @property {number} lastReceivedAudioLoudness - The current loudness of the audio input, nominal range 0.0
(no
+ * sound) – 1.0
(the onset of clipping). Read-only.
+ * @property {Uuid} sessionUUID - The unique ID associated with the agent's current session in the domain. Read-only.
*/
class AgentScriptingInterface : public QObject {
Q_OBJECT
@@ -54,20 +63,24 @@ public:
public slots:
/**jsdoc
+ * Set whether or not the script should emulate an avatar.
* @function Agent.setIsAvatar
- * @param {boolean} isAvatar
+ * @param {boolean} isAvatar - true
if the script should act as if an avatar, otherwise false
.
*/
void setIsAvatar(bool isAvatar) const { _agent->setIsAvatar(isAvatar); }
/**jsdoc
+ * Check whether or not the script is emulating an avatar.
* @function Agent.isAvatar
- * @returns {boolean}
+ * @returns {boolean} true
if the script is acting as if an avatar, otherwise false
.
*/
bool isAvatar() const { return _agent->isAvatar(); }
/**jsdoc
+ * Play a sound from the position and with the orientation of the emulated avatar's head. No sound is played unless
+ * isAvatar == true
.
* @function Agent.playAvatarSound
- * @param {object} avatarSound
+ * @param {SoundObject} avatarSound - The sound to play.
*/
void playAvatarSound(SharedSoundPointer avatarSound) const { _agent->playAvatarSound(avatarSound); }
diff --git a/assignment-client/src/avatars/ScriptableAvatar.h b/assignment-client/src/avatars/ScriptableAvatar.h
index b2ad4527b0..6b78f666e1 100644
--- a/assignment-client/src/avatars/ScriptableAvatar.h
+++ b/assignment-client/src/avatars/ScriptableAvatar.h
@@ -20,7 +20,7 @@
/**jsdoc
* The Avatar
API is used to manipulate scriptable avatars on the domain. This API is a subset of the
- * {@link MyAvatar} API.
+ * {@link MyAvatar} API. To enable this API, set {@link Agent|Agent.isAvatatr} to true
.
*
* @namespace Avatar
*
From 7f1ae634391eb8dce84f086ad60835b109c93b2f Mon Sep 17 00:00:00 2001
From: David Rowe 0.005
+ * and 1000.0
. When getting, the value may temporarily be further limited by the domain's settings.
* @property {number} density Read-only.
* @property {Vec3} handPosition
* @property {number} bodyYaw - The rotation left or right about an axis running from the head to the feet of the avatar.
@@ -50,8 +51,9 @@
* @property {number} audioLoudness
* @property {number} audioAverageLoudness
* @property {string} displayName
- * @property {string} sessionDisplayName - Sanitized, defaulted version displayName that is defined by the AvatarMixer
- * rather than by Interface clients. The result is unique among all avatars present at the time.
+ * @property {string} sessionDisplayName - Sanitized, defaulted version of displayName
that is defined by the
+ * avatar mixer rather than by Interface clients. The result is unique among all avatars present on the domain at the
+ * time.
* @property {boolean} lookAtSnappingEnabled
* @property {string} skeletonModelURL
* @property {AttachmentData[]} attachmentData
@@ -102,24 +104,12 @@ public:
Q_INVOKABLE AnimationDetails getAnimationDetails();
/**jsdoc
- * ####### TODO: If this override changes the function use @override and do JSDoc here, otherwise @comment that uses base class's JSDoc.Warning: Potentially a very expensive call. Do not use if possible.
* @function Avatar.getAvatarEntityData - * @returns {object} + * @returns {AvatarEntityMap} */ Q_INVOKABLE AvatarEntityMap getAvatarEntityData() const override; /**jsdoc - * ####### TODO: If this override changes the function use @override and do JSDoc here, otherwise @comment that uses base class's JSDoc. + * Set the avatar entities from binary data. + *Warning: Potentially an expensive call. Do not use if possible.
* @function Avatar.setAvatarEntityData - * @param {object} avatarEntityData + * @param {AvatarEntityMap} avatarEntityData */ Q_INVOKABLE void setAvatarEntityData(const AvatarEntityMap& avatarEntityData) override; /**jsdoc - * ####### TODO: If this override changes the function use @override and do JSDoc here, otherwise @comment that uses base class's JSDoc. - * @function Avatar.updateAvatarEntity - * @param {Uuid} entityID - * @param {string} entityData + * @comment Uses the base class's JSDoc. */ Q_INVOKABLE void updateAvatarEntity(const QUuid& entityID, const QByteArray& entityData) override; public slots: /**jsdoc * @function Avatar.update + * @param {number} deltaTime */ void update(float deltatime); /**jsdoc - * @function Avatar.setJointMappingsFromNetworkReply - */ + * @function Avatar.setJointMappingsFromNetworkReply + */ void setJointMappingsFromNetworkReply(); private: diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h index 7a4d235565..0a5509f46c 100755 --- a/libraries/avatars/src/AvatarData.h +++ b/libraries/avatars/src/AvatarData.h @@ -61,6 +61,10 @@ using AvatarSharedPointer = std::shared_ptr0.005
+ * and 1000.0
. When getting, the value may temporarily be further limited by the domain's settings.
* @property {number} density Read-only.
* @property {Vec3} handPosition
* @property {number} bodyYaw - The rotation left or right about an axis running from the head to the feet of the avatar.
@@ -436,8 +441,9 @@ class AvatarData : public QObject, public SpatiallyNestable {
* @property {number} audioLoudness
* @property {number} audioAverageLoudness
* @property {string} displayName
- * @property {string} sessionDisplayName - Sanitized, defaulted version displayName that is defined by the AvatarMixer
- * rather than by Interface clients. The result is unique among all avatars present at the time.
+ * @property {string} sessionDisplayName - Sanitized, defaulted version of displayName
that is defined by the
+ * avatar mixer rather than by Interface clients. The result is unique among all avatars present on the domain at the
+ * time.
* @property {boolean} lookAtSnappingEnabled
* @property {string} skeletonModelURL
* @property {AttachmentData[]} attachmentData
@@ -601,18 +607,18 @@ public:
virtual bool getHasAudioEnabledFaceMovement() const { return false; }
/**jsdoc
- * Returns the minimum scale allowed for this avatar in the current domain.
+ * Get the minimum scale allowed for this avatar in the current domain.
* This value can change as the user changes avatars or when changing domains.
* @function Avatar.getDomainMinScale
- * @returns {number} minimum scale allowed for this avatar in the current domain.
+ * @returns {number} The minimum scale allowed for this avatar in the current domain.
*/
Q_INVOKABLE float getDomainMinScale() const;
/**jsdoc
- * Returns the maximum scale allowed for this avatar in the current domain.
+ * Get the maximum scale allowed for this avatar in the current domain.
* This value can change as the user changes avatars or when changing domains.
* @function Avatar.getDomainMaxScale
- * @returns {number} maximum scale allowed for this avatar in the current domain.
+ * @returns {number} The maximum scale allowed for this avatar in the current domain.
*/
Q_INVOKABLE float getDomainMaxScale() const;
@@ -625,18 +631,18 @@ public:
virtual bool canMeasureEyeHeight() const { return false; }
/**jsdoc
- * Provides read only access to the current eye height of the avatar.
+ * Get the current eye height of the avatar.
* This height is only an estimate and might be incorrect for avatars that are missing standard joints.
* @function Avatar.getEyeHeight
- * @returns {number} Eye height of avatar in meters.
+ * @returns {number} The eye height of the avatar.
*/
Q_INVOKABLE virtual float getEyeHeight() const { return _targetScale * getUnscaledEyeHeight(); }
/**jsdoc
- * Provides read only access to the current height of the avatar.
+ * Get the current height of the avatar.
* This height is only an estimate and might be incorrect for avatars that are missing standard joints.
* @function Avatar.getHeight
- * @returns {number} Height of avatar in meters.
+ * @returns {number} The height of the avatar.
*/
Q_INVOKABLE virtual float getHeight() const;
@@ -739,7 +745,7 @@ public:
/**jsdoc
* Get the rotation of a joint relative to its parent. For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function Avatar.getJointRotation
* @param {number} index - The index of the joint.
* @returns {Quat} The rotation of the joint relative to its parent.
@@ -748,7 +754,7 @@ public:
/**jsdoc
* Get the translation of a joint relative to its parent. For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function Avatar.getJointTranslation
* @param {number} index - The index of the joint.
* @returns {Vec3} The translation of the joint relative to its parent.
@@ -855,7 +861,7 @@ public:
/**jsdoc
* Get the rotation of a joint relative to its parent. For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function Avatar.getJointRotation
* @param {string} name - The name of the joint.
* @returns {Quat} The rotation of the joint relative to its parent.
@@ -868,7 +874,7 @@ public:
/**jsdoc
* Get the translation of a joint relative to its parent. For information on the joint hierarchy used, see
- * Avatar Standards.
+ * Avatar Standards.
* @function Avatar.getJointTranslation
* @param {number} name - The name of the joint.
* @returns {Vec3} The translation of the joint relative to its parent.
@@ -883,7 +889,7 @@ public:
* Get the rotations of all joints in the current avatar. Each joint's rotation is relative to its parent joint.
* @function Avatar.getJointRotations
* @returns {Quat[]} The rotations of all joints relative to each's parent. The values are in the same order as the array
- * returned by {@link MyAvatar.getJointNames} or {@link Avatar.getJointNames}.
+ * returned by {@link MyAvatar.getJointNames}, or {@link Avatar.getJointNames} if using the Avatar
API.
* @example Avatar
API.
* @example Avatar
API.
* @function Avatar.getJointIndex
* @param {string} name - The name of the joint.
- * @returns {number} The index of the joint.
+ * @returns {number} The index of the joint if valid, otherwise -1
.
* @example true
if the script should act as if an avatar, otherwise false
.
+ * @example true
if the script is acting as if an avatar, otherwise false
.
*/
bool isAvatar() const { return _agent->isAvatar(); }
/**jsdoc
- * Play a sound from the position and with the orientation of the emulated avatar's head. No sound is played unless
+ * Plays a sound from the position and with the orientation of the emulated avatar's head. No sound is played unless
* isAvatar == true
.
* @function Agent.playAvatarSound
* @param {SoundObject} avatarSound - The sound to play.
From e79594ef53458f33f63ea5c135b48ce2d9698152 Mon Sep 17 00:00:00 2001
From: David Rowe Avatar
API is used to manipulate scriptable avatars on the domain. This API is a subset of the
* {@link MyAvatar} API. To enable this API, set {@link Agent|Agent.isAvatatr} to true
.
*
+ * For Interface, client entity, and avatar scripts, see {@link MyAvatar}.
+ * * @namespace Avatar * * @hifi-assignment-client * * @comment IMPORTANT: This group of properties is copied from AvatarData.h; they should NOT be edited here. - * @property {Vec3} position + * @property {Vec3} position - The position of the avatar. * @property {number} scale=1.0 - The scale of the avatar. When setting, the value is limited to between0.005
* and 1000.0
. When getting, the value may temporarily be further limited by the domain's settings.
- * @property {number} density Read-only.
- * @property {Vec3} handPosition
+ * @property {number} density - The density of the avatar in kg/m3. The density is used to work out its mass in
+ * the application of physics. Read-only.
+ * @property {Vec3} handPosition - A user-defined hand position, in world coordinates. The position moves with the avatar
+ * but is otherwise not used or changed by Interface.
* @property {number} bodyYaw - The rotation left or right about an axis running from the head to the feet of the avatar.
* Yaw is sometimes called "heading".
* @property {number} bodyPitch - The rotation about an axis running from shoulder to shoulder of the avatar. Pitch is
* sometimes called "elevation".
* @property {number} bodyRoll - The rotation about an axis running from the chest to the back of the avatar. Roll is
* sometimes called "bank".
- * @property {Quat} orientation
+ * @property {Quat} orientation - The orientation of the avatar.
* @property {Quat} headOrientation - The orientation of the avatar's head.
* @property {number} headPitch - The rotation about an axis running from ear to ear of the avatar's head. Pitch is
* sometimes called "elevation".
@@ -46,24 +50,31 @@
* head. Yaw is sometimes called "heading".
* @property {number} headRoll - The rotation about an axis running from the nose to the back of the avatar's head. Roll is
* sometimes called "bank".
- * @property {Vec3} velocity
- * @property {Vec3} angularVelocity
- * @property {number} audioLoudness
- * @property {number} audioAverageLoudness
- * @property {string} displayName
+ * @property {Vec3} velocity - The current velocity of the avatar.
+ * @property {Vec3} angularVelocity - The current angular velocity of the avatar.
+ * @property {number} audioLoudness - The instantaneous loudness of the audio input that the avatar is injecting into the
+ * domain.
+ * @property {number} audioAverageLoudness - The rolling average loudness of the audio input that the avatar is injecting
+ * into the domain.
+ * @property {string} displayName - The avatar's display name.
* @property {string} sessionDisplayName - Sanitized, defaulted version of displayName
that is defined by the
- * avatar mixer rather than by Interface clients. The result is unique among all avatars present on the domain at the
+ * avatar mixer rather than by Interface clients. The result is unique among all avatars present in the domain at the
* time.
- * @property {boolean} lookAtSnappingEnabled
- * @property {string} skeletonModelURL
- * @property {AttachmentData[]} attachmentData
+ * @property {boolean} lookAtSnappingEnabled=true - If true
, the avatar's eyes snap to look at another avatar's
+ * eyes if generally in the line of sight and the other avatar also has lookAtSnappingEnabled == true
.
+ * @property {string} skeletonModelURL - The URL of the avatar model's .fst
file.
+ * @property {AttachmentData[]} attachmentData - Information on the attachments worn by the avatar.true
if the animation should loop, false
if it shouldn't.
+ * @param {boolean} [hold=false] - Not used.
+ * @param {number} [firstFrame=0] - The frame the animation should start at.
+ * @param {number} [lastFrame=3.403e+38] - The frame the animation should stop at.
+ * @param {string[]} [maskedJoints=[]] - The names of joints that should not be animated.
*/
/// Allows scripts to run animations.
Q_INVOKABLE void startAnimation(const QString& url, float fps = 30.0f, float priority = 1.0f, bool loop = false,
@@ -93,13 +106,15 @@ public:
const QStringList& maskedJoints = QStringList());
/**jsdoc
+ * Stops playing the current animation.
* @function Avatar.stopAnimation
*/
Q_INVOKABLE void stopAnimation();
/**jsdoc
+ * Gets the details of the current avatar animation that is being or was recently played.
* @function Avatar.getAnimationDetails
- * @returns {Avatar.AnimationDetails}
+ * @returns {Avatar.AnimationDetails} The current or recent avatar animation.
*/
Q_INVOKABLE AnimationDetails getAnimationDetails();
@@ -116,6 +131,9 @@ public:
virtual void setSkeletonModelURL(const QUrl& skeletonModelURL) override;
+ /**jsdoc
+ * @comment Uses the base class's JSDoc.
+ */
int sendAvatarDataPacket(bool sendAll = false) override;
virtual QByteArray toByteArrayStateful(AvatarDataDetail dataDetail, bool dropFaceTracking = false) override;
@@ -128,7 +146,7 @@ public:
bool getHasAudioEnabledFaceMovement() const override { return _headData->getHasAudioEnabledFaceMovement(); }
/**jsdoc
- * Get the avatar entities as binary data.
+ * Gets the avatar entities as binary data.
* Warning: Potentially a very expensive call. Do not use if possible.
* @function Avatar.getAvatarEntityData * @returns {AvatarEntityMap} @@ -136,7 +154,7 @@ public: Q_INVOKABLE AvatarEntityMap getAvatarEntityData() const override; /**jsdoc - * Set the avatar entities from binary data. + * Sets the avatar entities from binary data. *Warning: Potentially an expensive call. Do not use if possible.
* @function Avatar.setAvatarEntityData * @param {AvatarEntityMap} avatarEntityData @@ -151,12 +169,14 @@ public: public slots: /**jsdoc * @function Avatar.update - * @param {number} deltaTime + * @param {number} deltaTime - Delta time. + * @deprecated This function is deprecated and will be removed. */ void update(float deltatime); /**jsdoc * @function Avatar.setJointMappingsFromNetworkReply + * @deprecated This function is deprecated and will be removed. */ void setJointMappingsFromNetworkReply(); diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h index 1aa6829160..98aa255641 100644 --- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h +++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h @@ -219,7 +219,7 @@ public: * The default pose of the avatar is defined by the position and orientation of all bones * in the avatar's model file. Typically this is a T-pose. * @function MyAvatar.getAbsoluteDefaultJointRotationInObjectFrame - * @param index {number} index number + * @param index {number} -The joint index. * @returns {Quat} The rotation of this joint in avatar coordinates. */ Q_INVOKABLE virtual glm::quat getAbsoluteDefaultJointRotationInObjectFrame(int index) const; @@ -229,7 +229,7 @@ public: * The default pose of the avatar is defined by the position and orientation of all bones * in the avatar's model file. Typically this is a T-pose. * @function MyAvatar.getAbsoluteDefaultJointTranslationInObjectFrame - * @param index {number} index number + * @param index {number} - The joint index. * @returns {Vec3} The position of this joint in avatar coordinates. */ Q_INVOKABLE virtual glm::vec3 getAbsoluteDefaultJointTranslationInObjectFrame(int index) const; @@ -238,7 +238,25 @@ public: virtual glm::vec3 getAbsoluteJointScaleInObjectFrame(int index) const override; virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const override; virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const override; + + /**jsdoc + * Sets the rotation of a joint relative to the avatar. + *Warning: Not able to be used in the MyAvatar
API.
false
.
+ */
virtual bool setAbsoluteJointRotationInObjectFrame(int index, const glm::quat& rotation) override { return false; }
+
+ /**jsdoc
+ * Sets the translation of a joint relative to the avatar.
+ * Warning: Not able to be used in the MyAvatar
API.
false
.
+ */
virtual bool setAbsoluteJointTranslationInObjectFrame(int index, const glm::vec3& translation) override { return false; }
// world-space to avatar-space rigconversion functions
diff --git a/libraries/avatars/src/AvatarData.cpp b/libraries/avatars/src/AvatarData.cpp
index c733cfa291..88949900ce 100755
--- a/libraries/avatars/src/AvatarData.cpp
+++ b/libraries/avatars/src/AvatarData.cpp
@@ -1425,6 +1425,47 @@ int AvatarData::parseDataFromBuffer(const QByteArray& buffer) {
return numBytesRead;
}
+/**jsdoc
+ * The avatar mixer data comprises different types of data, with the data rates of each being tracked in kbps.
+ *
+ * Rate Name | Description |
---|---|
"globalPosition" | Incoming global position. |
"localPosition" | Incoming local position. |
"avatarBoundingBox" | Incoming avatar bounding box. |
"avatarOrientation" | Incoming avatar orientation. |
"avatarScale" | Incoming avatar scale. |
"lookAtPosition" | Incoming look-at position. |
"audioLoudness" | Incoming audio loudness. |
"sensorToWorkMatrix" | Incoming sensor-to-world matrix. |
"additionalFlags" | Incoming additional avatar flags. |
"parentInfo" | Incoming parent information. |
"faceTracker" | Incoming face tracker data. |
"jointData" | Incoming joint data. |
"jointDefaultPoseFlagsRate" | Incoming joint default pose flags. |
"farGrabJointRate" | Incoming far grab joint. |
"globalPositionOutbound" | Outgoing global position. |
"localPositionOutbound" | Outgoing local position. |
"avatarBoundingBoxOutbound" | Outgoing avatar bounding box. |
"avatarOrientationOutbound" | Outgoing avatar orientation. |
"avatarScaleOutbound" | Outgoing avatar scale. |
"lookAtPositionOutbound" | Outgoing look-at position. |
"audioLoudnessOutbound" | Outgoing audio loudness. |
"sensorToWorkMatrixOutbound" | Outgoing sensor-to-world matrix. |
"additionalFlagsOutbound" | Outgoing additional avatar flags. |
"parentInfoOutbound" | Outgoing parent information. |
"faceTrackerOutbound" | Outgoing face tracker data. |
"jointDataOutbound" | Outgoing joint data. |
"jointDefaultPoseFlagsOutbound" | Outgoing joint default pose flags. |
"" | When no rate name is specified, the total incoming data rate is provided. |
Rate Name | Description |
---|---|
"globalPosition" | Global position. |
"localPosition" | Local position. |
"avatarBoundingBox" | Avatar bounding box. |
"avatarOrientation" | Avatar orientation. |
"avatarScale" | Avatar scale. |
"lookAtPosition" | Look-at position. |
"audioLoudness" | Audio loudness. |
"sensorToWorkMatrix" | Sensor-to-world matrix. |
"additionalFlags" | Additional avatar flags. |
"parentInfo" | Parent information. |
"faceTracker" | Face tracker data. |
"jointData" | Joint data. |
"farGrabJointData" | Far grab joint data. |
"" | When no rate name is specified, the overall update rate is provided. |
true
and the model has a skeleton, the bones of the attached model's skeleton are
+ * rotated to fit the avatar's current pose. If true
, the translation
, rotation
, and
+ * scale
parameters are ignored.
*/
QVariant AttachmentData::toVariant() const {
QVariantMap result;
diff --git a/libraries/avatars/src/AvatarData.h b/libraries/avatars/src/AvatarData.h
index 0a5509f46c..a20518076f 100755
--- a/libraries/avatars/src/AvatarData.h
+++ b/libraries/avatars/src/AvatarData.h
@@ -116,7 +116,24 @@ const int PROCEDURAL_EYE_FACE_MOVEMENT = 9; // 10th bit
const int PROCEDURAL_BLINK_FACE_MOVEMENT = 10; // 11th bit
const int COLLIDE_WITH_OTHER_AVATARS = 11; // 12th bit
-
+/**jsdoc
+ * The pointing state of the hands is specified by the following values: +
+ *Value | Description | + *
---|---|
0 | No hand is pointing. |
1 | The left hand is pointing. |
2 | The right hand is pointing. |
4 | It is the index finger that is pointing. |
The values for the hand states are added together to give the Setting joint data completely overrides/replaces all motion from the default animation system including inverse
* kinematics, but just for the specified joint. So for example, if you were to procedurally manipulate the finger joints,
* the avatar's hand and head would still do inverse kinematics properly. However, as soon as you start to manipulate
@@ -702,7 +735,7 @@ public:
Q_INVOKABLE virtual void setJointData(int index, const glm::quat& rotation, const glm::vec3& translation);
/**jsdoc
- * Set a specific joint's rotation relative to its parent.
+ * Sets a specific joint's rotation relative to its parent.
* Setting joint data completely overrides/replaces all motion from the default animation system including inverse
* kinematics, but just for the specified joint. So for example, if you were to procedurally manipulate the finger joints,
* the avatar's hand and head would still do inverse kinematics properly. However, as soon as you start to manipulate
@@ -715,7 +748,7 @@ public:
Q_INVOKABLE virtual void setJointRotation(int index, const glm::quat& rotation);
/**jsdoc
- * Set a specific joint's translation relative to its parent.
+ * Sets a specific joint's translation relative to its parent.
* Setting joint data completely overrides/replaces all motion from the default animation system including inverse
* kinematics, but just for the specified joint. So for example, if you were to procedurally manipulate the finger joints,
* the avatar's hand and head would still do inverse kinematics properly. However, as soon as you start to manipulate
@@ -728,7 +761,7 @@ public:
Q_INVOKABLE virtual void setJointTranslation(int index, const glm::vec3& translation);
/**jsdoc
- * Clear joint translations and rotations set by script for a specific joint. This restores all motion from the default
+ * Clears joint translations and rotations set by script for a specific joint. This restores all motion from the default
* animation system including inverse kinematics for that joint.
* Note: This is slightly faster than the function variation that specifies the joint name. Setting joint data completely overrides/replaces all motion from the default animation system including inverse
* kinematics, but just for the specified joint. So for example, if you were to procedurally manipulate the finger joints,
* the avatar's hand and head would still do inverse kinematics properly. However, as soon as you start to manipulate
@@ -776,7 +810,7 @@ public:
Q_INVOKABLE virtual void setJointData(const QString& name, const glm::quat& rotation, const glm::vec3& translation);
/**jsdoc
- * Set a specific joint's rotation relative to its parent.
+ * Sets a specific joint's rotation relative to its parent.
* Setting joint data completely overrides/replaces all motion from the default animation system including inverse
* kinematics, but just for the specified joint. So for example, if you were to procedurally manipulate the finger joints,
* the avatar's hand and head would still do inverse kinematics properly. However, as soon as you start to manipulate
@@ -809,7 +843,7 @@ public:
Q_INVOKABLE virtual void setJointRotation(const QString& name, const glm::quat& rotation);
/**jsdoc
- * Set a specific joint's translation relative to its parent.
+ * Sets a specific joint's translation relative to its parent.
* Setting joint data completely overrides/replaces all motion from the default animation system including inverse
* kinematics, but just for the specified joint. So for example, if you were to procedurally manipulate the finger joints,
* the avatar's hand and head would still do inverse kinematics properly. However, as soon as you start to manipulate
@@ -834,7 +868,7 @@ public:
Q_INVOKABLE virtual void setJointTranslation(const QString& name, const glm::vec3& translation);
/**jsdoc
- * Clear joint translations and rotations set by script for a specific joint. This restores all motion from the default
+ * Clears joint translations and rotations set by script for a specific joint. This restores all motion from the default
* animation system including inverse kinematics for that joint.
* Note: This is slightly slower than the function variation that specifies the joint index. Setting joint data completely overrides/replaces all motion from the default animation system including inverse
* kinematics, but just for the specified joint. So for example, if you were to procedurally manipulate the finger joints,
* the avatar's hand and head would still do inverse kinematics properly. However, as soon as you start to manipulate
@@ -942,13 +979,20 @@ public:
Q_INVOKABLE virtual void setJointRotations(const QVector Setting joint data completely overrides/replaces all motion from the default animation system including inverse
+ * kinematics, but just for the specified joint. So for example, if you were to procedurally manipulate the finger joints,
+ * the avatar's hand and head would still do inverse kinematics properly. However, as soon as you start to manipulate
+ * joints in the inverse kinematics chain, the inverse kinematics might not function as you expect. For example, if you set
+ * the rotation of the elbow, the hand inverse kinematics position won't end up in the right place. Note: Attached models are models only; they are not entities and can not be manipulated using the {@link Entities} API.
* Nor can you use this function to attach an entity (such as a sphere or a box) to your avatar. Warning: Not able to be used in the Warning: Not able to be used in the Warning: Not able to be used in the Warning: Not able to be used in the For assignment client scripts, see {@link Avatar}. The internal inverse-kinematics system maintains a record of which joints are "locked". Sometimes it is useful to
+ * forget this history, to prevent contorted joints. The avatar animation system includes a set of default animations along with rules for how those animations are blended
+ * together with procedural data (such as look at vectors, hand sensors etc.). Note: When using pre-built animation data, it's critical that the joint orientation of the source animation and target
* rig are equivalent, since the animation data applies absolute values onto the joints. If the orientations are different,
* the avatar will move in unpredictable ways. For more information about avatar joint orientation standards, see
- * Avatar Standards. The avatar animation system includes a set of default animations along with rules for how those animations are blended
+ * together with procedural data (such as look at vectors, hand sensors etc.). Playing your own custom animations will
+ * override the default animations. Each avatar has an avatar-animation.json file that defines which animations are used and how they are blended together
+ * with procedural data (such as look at vectors, hand sensors etc.). Each animation specified in the avatar-animation.json
+ * file is known as an animation role. Animation roles map to easily understandable actions that the avatar can perform,
+ * such as Each avatar has an avatar-animation.json file that defines a set of animation roles. Animation roles map to easily
+ * understandable actions that the avatar can perform, such as Note: Hand roles only affect the hand. Other 'main' roles, like 'idleStand', 'idleTalk', 'takeoffStand' are full body. Note: When using pre-built animation data, it's critical that the joint orientation of the source animation and target
* rig are equivalent, since the animation data applies absolute values onto the joints. If the orientations are different,
* the avatar will move in unpredictable ways. For more information about avatar joint orientation standards, see
- * Avatar Standards.
+ * Avatar Standards.
* @function MyAvatar.overrideRoleAnimation
* @param role {string} The animation role to override
* @param url {string} The URL to the animation file. Animation files need to be .FBX format, but only need to contain the avatar skeleton and animation data.
@@ -548,13 +574,15 @@ public:
Q_INVOKABLE void overrideRoleAnimation(const QString& role, const QString& url, float fps, bool loop, float firstFrame, float lastFrame);
/**jsdoc
- * Each avatar has an avatar-animation.json file that defines a set of animation roles. Animation roles map to easily understandable actions that
- * the avatar can perform, such as "idleStand", "idleTalk", or "walkFwd". To get the full list of roles, use getAnimationRoles(). For each role,
- * the avatar-animation.json defines when the animation is used, the animation clip (.FBX) used, and how animations are blended together with
- * procedural data (such as look at vectors, hand sensors etc.). You can change the animation clip (.FBX) associated with a specified animation
- * role using overrideRoleAnimation().
- * restoreRoleAnimation() is used to restore a specified animation role's default animation clip. If you have not specified an override animation
- * for the specified role, this function will have no effect.
+ * Restores a default role animation.
+ * Each avatar has an avatar-animation.json file that defines a set of animation roles. Animation roles map to easily
+ * understandable actions that the avatar can perform, such as The hand touch effect makes the avatar's fingers adapt to the shape of any object grabbed, creating the effect that
+ * it is really touching that object. The hand touch effect makes the avatar's fingers adapt to the shape of any object grabbed, creating the effect that
+ * it is really touching that object. The hand touch effect makes the avatar's fingers adapt to the shape of any object grabbed, creating the effect that
+ * it is really touching that object. The hand touch effect makes the avatar's fingers adapt to the shape of any object grabbed, creating the effect that
+ * it is really touching that object. Note: The Leap Motion isn't part of the hand controller input system. (Instead, it manipulates the avatar's joints
* for hand animation.) Note: The Leap Motion isn't part of the hand controller input system. (Instead, it manipulates the avatar's joints
* for hand animation.) Note: The Leap Motion isn't part of the hand controller input system. (Instead, it manipulates the avatar's joints
* for hand animation.) If you are using the Leap Motion, the return value's Note: The Leap Motion isn't part of the hand controller input system. (Instead, it manipulates the avatar's joints
* for hand animation.) If you are using the Leap Motion, the return value's The hand touch effect makes the avatar's fingers adapt to the shape of any object grabbed, creating the effect that
+ * it is really touching that object. The hand touch effect makes the avatar's fingers adapt to the shape of any object grabbed, creating the effect that
+ * it is really touching that object. Wallets used to be stored locally but now they're stored on the server, unless the computer once had a wallet stored
- * locally in which case the wallet may be present in both places. Wallets used to be stored locally but now they're only stored on the server. A wallet is present in both places if
+ * your computer previously stored its information locally.HandState
value. For example, if the left
+ * hand's finger is pointing, the value is 1 + 4 == 5.
+ * @typedef {number} HandState
+ */
const char HAND_STATE_NULL = 0;
const char LEFT_HAND_POINTING_FLAG = 1;
const char RIGHT_HAND_POINTING_FLAG = 2;
@@ -417,18 +434,20 @@ class AvatarData : public QObject, public SpatiallyNestable {
// IMPORTANT: The JSDoc for the following properties should be copied to MyAvatar.h and ScriptableAvatar.h.
/*
- * @property {Vec3} position
+ * @property {Vec3} position - The position of the avatar.
* @property {number} scale=1.0 - The scale of the avatar. When setting, the value is limited to between
0.005
* and 1000.0
. When getting, the value may temporarily be further limited by the domain's settings.
- * @property {number} density Read-only.
- * @property {Vec3} handPosition
+ * @property {number} density - The density of the avatar in kg/m3. The density is used to work out its mass in
+ * the application of physics. Read-only.
+ * @property {Vec3} handPosition - A user-defined hand position, in world coordinates. The position moves with the avatar
+ * but is otherwise not used or changed by Interface.
* @property {number} bodyYaw - The rotation left or right about an axis running from the head to the feet of the avatar.
* Yaw is sometimes called "heading".
* @property {number} bodyPitch - The rotation about an axis running from shoulder to shoulder of the avatar. Pitch is
* sometimes called "elevation".
* @property {number} bodyRoll - The rotation about an axis running from the chest to the back of the avatar. Roll is
* sometimes called "bank".
- * @property {Quat} orientation
+ * @property {Quat} orientation - The orientation of the avatar.
* @property {Quat} headOrientation - The orientation of the avatar's head.
* @property {number} headPitch - The rotation about an axis running from ear to ear of the avatar's head. Pitch is
* sometimes called "elevation".
@@ -436,23 +455,31 @@ class AvatarData : public QObject, public SpatiallyNestable {
* head. Yaw is sometimes called "heading".
* @property {number} headRoll - The rotation about an axis running from the nose to the back of the avatar's head. Roll is
* sometimes called "bank".
- * @property {Vec3} velocity
- * @property {Vec3} angularVelocity
- * @property {number} audioLoudness
- * @property {number} audioAverageLoudness
- * @property {string} displayName
+ * @property {Vec3} velocity - The current velocity of the avatar.
+ * @property {Vec3} angularVelocity - The current angular velocity of the avatar.
+ * @property {number} audioLoudness - The instantaneous loudness of the audio input that the avatar is injecting into the
+ * domain.
+ * @property {number} audioAverageLoudness - The rolling average loudness of the audio input that the avatar is injecting
+ * into the domain.
+ * @property {string} displayName - The avatar's display name.
* @property {string} sessionDisplayName - Sanitized, defaulted version of displayName
that is defined by the
- * avatar mixer rather than by Interface clients. The result is unique among all avatars present on the domain at the
+ * avatar mixer rather than by Interface clients. The result is unique among all avatars present in the domain at the
* time.
- * @property {boolean} lookAtSnappingEnabled
- * @property {string} skeletonModelURL
- * @property {AttachmentData[]} attachmentData
+ * @property {boolean} lookAtSnappingEnabled=true - If true
, the avatar's eyes snap to look at another avatar's
+ * eyes if generally in the line of sight and the other avatar also has lookAtSnappingEnabled == true
.
+ * @property {string} skeletonModelURL - The URL of the avatar model's .fst
file.
+ * @property {AttachmentData[]} attachmentData - Information on the attachments worn by the avatar.
+ * Deprecated: Use avatar entities instead.
* @property {string[]} jointNames - The list of joints in the current avatar model. Read-only.
- * @property {Uuid} sessionUUID Read-only.
- * @property {Mat4} sensorToWorldMatrix Read-only.
- * @property {Mat4} controllerLeftHandMatrix Read-only.
- * @property {Mat4} controllerRightHandMatrix Read-only.
- * @property {number} sensorToWorldScale Read-only.
+ * @property {Uuid} sessionUUID - Unique ID of the avatar in the domain. Read-only.
+ * @property {Mat4} sensorToWorldMatrix - The scale, rotation, and translation transform from the user's real world to the
+ * avatar's size, orientation, and position in the virtual world. Read-only.
+ * @property {Mat4} controllerLeftHandMatrix - The rotation and translation of the left hand controller relative to the
+ * avatar. Read-only.
+ * @property {Mat4} controllerRightHandMatrix - The rotation and translation of the right hand controller relative to the
+ * avatar. Read-only.
+ * @property {number} sensorToWorldScale - The scale that transforms dimensions in the user's real world to the avatar's
+ * size in the virtual world. Read-only.
*/
Q_PROPERTY(glm::vec3 position READ getWorldPosition WRITE setPositionViaScript)
Q_PROPERTY(float scale READ getDomainLimitedScale WRITE setTargetScale)
@@ -607,7 +634,7 @@ public:
virtual bool getHasAudioEnabledFaceMovement() const { return false; }
/**jsdoc
- * Get the minimum scale allowed for this avatar in the current domain.
+ * Gets the minimum scale allowed for this avatar in the current domain.
* This value can change as the user changes avatars or when changing domains.
* @function Avatar.getDomainMinScale
* @returns {number} The minimum scale allowed for this avatar in the current domain.
@@ -615,7 +642,7 @@ public:
Q_INVOKABLE float getDomainMinScale() const;
/**jsdoc
- * Get the maximum scale allowed for this avatar in the current domain.
+ * Gets the maximum scale allowed for this avatar in the current domain.
* This value can change as the user changes avatars or when changing domains.
* @function Avatar.getDomainMaxScale
* @returns {number} The maximum scale allowed for this avatar in the current domain.
@@ -631,7 +658,7 @@ public:
virtual bool canMeasureEyeHeight() const { return false; }
/**jsdoc
- * Get the current eye height of the avatar.
+ * Gets the current eye height of the avatar.
* This height is only an estimate and might be incorrect for avatars that are missing standard joints.
* @function Avatar.getEyeHeight
* @returns {number} The eye height of the avatar.
@@ -639,7 +666,7 @@ public:
Q_INVOKABLE virtual float getEyeHeight() const { return _targetScale * getUnscaledEyeHeight(); }
/**jsdoc
- * Get the current height of the avatar.
+ * Gets the current height of the avatar.
* This height is only an estimate and might be incorrect for avatars that are missing standard joints.
* @function Avatar.getHeight
* @returns {number} The height of the avatar.
@@ -652,27 +679,33 @@ public:
void setDomainMaximumHeight(float domainMaximumHeight);
/**jsdoc
+ * Sets the pointing state of the hands to control where the laser emanates from. If the right index finger is pointing, the
+ * laser emanates from the tip of that finger, otherwise it emanates from the palm.
* @function Avatar.setHandState
- * @param {string} state
+ * @param {HandState} state - The pointing state of the hand.
*/
Q_INVOKABLE void setHandState(char s) { _handState = s; }
/**jsdoc
+ * Gets the pointing state of the hands to control where the laser emanates from. If the right index finger is pointing, the
+ * laser emanates from the tip of that finger, otherwise it emanates from the palm.
* @function Avatar.getHandState
- * @returns {string}
+ * @returns {HandState} The pointing state of the hand.
*/
Q_INVOKABLE char getHandState() const { return _handState; }
const QVectortrue
if the joint data is valid, false
if not.
*/
Q_INVOKABLE bool isJointDataValid(int index) const;
/**jsdoc
- * Get the rotation of a joint relative to its parent. For information on the joint hierarchy used, see
+ * Gets the rotation of a joint relative to its parent. For information on the joint hierarchy used, see
* Avatar Standards.
* @function Avatar.getJointRotation
* @param {number} index - The index of the joint.
@@ -753,7 +787,7 @@ public:
Q_INVOKABLE virtual glm::quat getJointRotation(int index) const;
/**jsdoc
- * Get the translation of a joint relative to its parent. For information on the joint hierarchy used, see
+ * Gets the translation of a joint relative to its parent. For information on the joint hierarchy used, see
* Avatar Standards.
* @function Avatar.getJointTranslation
* @param {number} index - The index of the joint.
@@ -762,7 +796,7 @@ public:
Q_INVOKABLE virtual glm::vec3 getJointTranslation(int index) const;
/**jsdoc
- * Set a specific joint's rotation and position relative to its parent.
+ * Sets a specific joint's rotation and position relative to its parent.
* true
if the joint data is valid, false
if not.
*/
Q_INVOKABLE virtual bool isJointDataValid(const QString& name) const;
/**jsdoc
- * Get the rotation of a joint relative to its parent. For information on the joint hierarchy used, see
+ * Gets the rotation of a joint relative to its parent. For information on the joint hierarchy used, see
* Avatar Standards.
* @function Avatar.getJointRotation
* @param {string} name - The name of the joint.
@@ -873,7 +908,7 @@ public:
Q_INVOKABLE virtual glm::quat getJointRotation(const QString& name) const;
/**jsdoc
- * Get the translation of a joint relative to its parent. For information on the joint hierarchy used, see
+ * Gets the translation of a joint relative to its parent. For information on the joint hierarchy used, see
* Avatar Standards.
* @function Avatar.getJointTranslation
* @param {number} name - The name of the joint.
@@ -886,7 +921,7 @@ public:
Q_INVOKABLE virtual glm::vec3 getJointTranslation(const QString& name) const;
/**jsdoc
- * Get the rotations of all joints in the current avatar. Each joint's rotation is relative to its parent joint.
+ * Gets the rotations of all joints in the current avatar. Each joint's rotation is relative to its parent joint.
* @function Avatar.getJointRotations
* @returns {Quat[]} The rotations of all joints relative to each's parent. The values are in the same order as the array
* returned by {@link MyAvatar.getJointNames}, or {@link Avatar.getJointNames} if using the Avatar
API.
@@ -898,13 +933,15 @@ public:
Q_INVOKABLE virtual QVectorAvatar
API.
*/
Q_INVOKABLE virtual QVectorAvatar
API.
*/
Q_INVOKABLE virtual void setJointTranslations(const QVectorAvatar
API.
* @function Avatar.getJointIndex
* @param {string} name - The name of the joint.
@@ -984,7 +1028,7 @@ public:
Q_INVOKABLE virtual int getJointIndex(const QString& name) const;
/**jsdoc
- * Get the names of all the joints in the current avatar.
+ * Gets the names of all the joints in the current avatar.
* @function Avatar.getJointNames
* @returns {string[]} The joint names.
* @example 0.0
and 1.0
.
*/
Q_INVOKABLE void setBlendshape(QString name, float val) { _headData->setBlendshape(name, val); }
/**jsdoc
+ * Gets information about the models currently attached to your avatar.
* @function Avatar.getAttachmentsVariant
- * @returns {object}
+ * @returns {AttachmentData[]} Information about all models attached to your avatar.
+ * @deprecated Use avatar entities instead.
*/
// FIXME: Can this name be improved? Can it be deprecated?
Q_INVOKABLE virtual QVariantList getAttachmentsVariant() const;
/**jsdoc
+ * Sets all models currently attached to your avatar. For example, if you retrieve attachment data using
+ * {@link MyAvatar.getAttachmentsVariant} or {@link Avatar.getAttachmentsVariant}, make changes to it, and then want to
+ * update your avatar's attachments per the changed data.
* @function Avatar.setAttachmentsVariant
- * @param {object} variant
+ * @param {AttachmentData[]} variant - The attachment data defining the models to have attached to your avatar.
+ * @deprecated Use avatar entities instead.
*/
// FIXME: Can this name be improved? Can it be deprecated?
Q_INVOKABLE virtual void setAttachmentsVariant(const QVariantList& variant);
@@ -1021,22 +1074,27 @@ public:
/**jsdoc
* @function Avatar.updateAvatarEntity
- * @param {Uuid} entityID
- * @param {Array.true
to enable blendshape changes to be transmitted to other users,
+ * false
to disable.
*/
Q_INVOKABLE void setForceFaceTrackerConnected(bool connected) { _forceFaceTrackerConnected = connected; }
@@ -1087,9 +1145,10 @@ public:
}
/**jsdoc
- * Get information about all models currently attached to your avatar.
+ * Gets information about the models currently attached to your avatar.
* @function Avatar.getAttachmentData
* @returns {AttachmentData[]} Information about all models attached to your avatar.
+ * @deprecated Use avatar entities instead.
* @example attachmentData
to null
.
* @function Avatar.setAttachmentData
- * @param {AttachmentData[]} attachmentData - The attachment data defining the models to have attached to your avatar. Use
+ * @param {AttachmentData[]} attachmentData - The attachment data defining the models to have attached to your avatar. Use
* null
to remove all attachments.
+ * @deprecated Use avatar entities instead.
* @example true
so that the bones of the
- * attached model's skeleton are be rotated to fit the avatar's current pose. isSoft
is used, for example,
+ * attached model's skeleton are rotated to fit the avatar's current pose. isSoft
is used, for example,
* to have clothing that moves with the avatar.
* If true
, the translation
, rotation
, and scale
parameters are
* ignored.
- * @param {boolean} [allowDuplicates=false]
- * @param {boolean} [useSaved=true]
+ * @param {boolean} [allowDuplicates=false] - If true
then more than one copy of any particular model may be
+ * attached to the same joint; if false
then the same model cannot be attached to the same joint.
+ * @param {boolean} [useSaved=true] - Not used.
+ * @deprecated Use avatar entities instead.
* @example ""
, then the most
* recently attached model is removed from which ever joint it was attached to.
+ * @deprecated Use avatar entities instead.
*/
Q_INVOKABLE virtual void detachOne(const QString& modelURL, const QString& jointName = QString());
/**jsdoc
- * Detach all instances of a particular model from either a specific joint or all joints.
+ * Detaches all instances of a particular model from either a specific joint or all joints.
* @function Avatar.detachAll
* @param {string} modelURL - The URL of the model to detach.
* @param {string} [jointName=""] - The name of the joint to detach the model from. If ""
, then the model is
* detached from all joints.
+ * @deprecated Use avatar entities instead.
*/
Q_INVOKABLE virtual void detachAll(const QString& modelURL, const QString& jointName = QString());
@@ -1220,45 +1284,53 @@ public:
AvatarEntityIDs getAndClearRecentlyRemovedIDs();
/**jsdoc
+ * Gets the transform from the user's real world to the avatar's size, orientation, and position in the virtual world.
* @function Avatar.getSensorToWorldMatrix
- * @returns {Mat4}
+ * @returns {Mat4} The scale, rotation, and translation transform from the user's real world to the avatar's size,
+ * orientation, and position in the virtual world.
*/
// thread safe
Q_INVOKABLE glm::mat4 getSensorToWorldMatrix() const;
/**jsdoc
+ * Gets the scale that transforms dimensions in the user's real world to the avatar's size in the virtual world.
* @function Avatar.getSensorToWorldScale
- * @returns {number}
+ * @returns {number} The scale that transforms dimensions in the user's real world to the avatar's size in the virtual
+ * world.
*/
// thread safe
Q_INVOKABLE float getSensorToWorldScale() const;
/**jsdoc
+ * Gets the rotation and translation of the left hand controller relative to the avatar.
* @function Avatar.getControllerLeftHandMatrix
- * @returns {Mat4}
+ * @returns {Mat4} The rotation and translation of the left hand controller relative to the avatar.
*/
// thread safe
Q_INVOKABLE glm::mat4 getControllerLeftHandMatrix() const;
/**jsdoc
+ * Gets the rotation and translation of the right hand controller relative to the avatar.
* @function Avatar.getControllerRightHandMatrix
- * @returns {Mat4}
+ * @returns {Mat4} The rotation and translation of the right hand controller relative to the avatar.
*/
// thread safe
Q_INVOKABLE glm::mat4 getControllerRightHandMatrix() const;
/**jsdoc
+ * Gets the amount of avatar mixer data being generated by the avatar.
* @function Avatar.getDataRate
- * @param {string} [rateName=""]
- * @returns {number}
+ * @param {AvatarDataRate} [rateName=""] - The type of avatar mixer data to get the data rate of.
+ * @returns {number} The data rate in kbps.
*/
Q_INVOKABLE float getDataRate(const QString& rateName = QString("")) const;
/**jsdoc
+ * Gets the update rate of avatar mixer data being generated by the avatar.
* @function Avatar.getUpdateRate
- * @param {string} [rateName=""]
- * @returns {number}
+ * @param {AvatarUpdateRate} [rateName=""] - The type of avatar mixer data to get the update rate of.
+ * @returns {number} The update rate in Hz.
*/
Q_INVOKABLE float getUpdateRate(const QString& rateName = QString("")) const;
@@ -1304,31 +1376,36 @@ public:
signals:
/**jsdoc
+ * Triggered when the avatar's displayName
property value changes.
* @function Avatar.displayNameChanged
* @returns {Signal}
*/
void displayNameChanged();
/**jsdoc
+ * Triggered when the avattr's sessionDisplayName
property value changes.
* @function Avatar.sessionDisplayNameChanged
* @returns {Signal}
*/
void sessionDisplayNameChanged();
/**jsdoc
+ * Triggered when the avatar's skeletonModelURL
property value changes.
* @function Avatar.skeletonModelURLChanged
* @returns {Signal}
*/
void skeletonModelURLChanged();
/**jsdoc
+ * Triggered when the avatar's lookAtSnappingEnabled
property value changes.
* @function Avatar.lookAtSnappingChanged
- * @param {boolean} enabled
+ * @param {boolean} enabled - true
if look-at snapping is enabled, false
if not.
* @returns {Signal}
*/
void lookAtSnappingChanged(bool enabled);
/**jsdoc
+ * Triggered when the avatar's sessionUUID
property value changes.
* @function Avatar.sessionUUIDChanged
* @returns {Signal}
*/
@@ -1338,18 +1415,23 @@ public slots:
/**jsdoc
* @function Avatar.sendAvatarDataPacket
- * @param {boolean} [sendAll=false]
+ * @param {boolean} [sendAll=false] - Send all.
+ * @returns {number}
+ * @deprecated This function is deprecated and will be removed.
*/
virtual int sendAvatarDataPacket(bool sendAll = false);
/**jsdoc
* @function Avatar.sendIdentityPacket
+ * @returns {number}
+ * @deprecated This function is deprecated and will be removed.
*/
int sendIdentityPacket();
/**jsdoc
* @function Avatar.setSessionUUID
- * @param {Uuid} sessionUUID
+ * @param {Uuid} sessionUUID - Session UUID.
+ * @deprecated This function is deprecated and will be removed.
*/
virtual void setSessionUUID(const QUuid& sessionUUID) {
if (sessionUUID != getID()) {
@@ -1362,44 +1444,61 @@ public slots:
}
}
+
/**jsdoc
+ * Gets the rotation of a joint relative to the avatar.
+ * Avatar
API.Quat.IDENTITY
.
*/
virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const override;
/**jsdoc
+ * Gets the translation of a joint relative to the avatar.
+ * Avatar
API.Vec3.ZERO
.
*/
virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const override;
/**jsdoc
+ * Sets the rotation of a joint relative to the avatar.
+ * Avatar
API.false
.
*/
virtual bool setAbsoluteJointRotationInObjectFrame(int index, const glm::quat& rotation) override { return false; }
/**jsdoc
+ * Sets the translation of a joint relative to the avatar.
+ * Avatar
API.false
.
*/
virtual bool setAbsoluteJointTranslationInObjectFrame(int index, const glm::vec3& translation) override { return false; }
/**jsdoc
+ * Gets the target scale of the avatar without any restrictions on permissible values imposed by the domain. In contrast, the
+ * scale
property's value may be limited by the domain's settings.
* @function Avatar.getTargetScale
- * @returns {number}
+ * @returns {number} The target scale of the avatar.
+ * @example true
if the animation should loop, false
if it shouldn't.
+ * @property {boolean} hold - Not used.
+ * @property {number} firstFrame - The frame the animation should start at.
+ * @property {number} lastFrame - The frame the animation should stop at.
+ * @property {boolean} running - Not used.
+ * @property {number} currentFrame - The current frame being played.
+ * @property {boolean} startAutomatically - Not used.
+ * @property {boolean} allowTranslation - Not used.
*/
QScriptValue animationDetailsToScriptValue(QScriptEngine* engine, const AnimationDetails& details) {
QScriptValue obj = engine->newObject();
From aa53ab7492b15f183754fc11f7886539364ae29a Mon Sep 17 00:00:00 2001
From: David Rowe
+ *
+ *
+ * @typedef {object} MyAvatar.AvatarEntityData
+ */
QVariantList MyAvatar::getAvatarEntitiesVariant() {
// NOTE: this method is NOT efficient
QVariantList avatarEntitiesData;
diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h
index d689d2f215..a0f1531e64 100755
--- a/interface/src/avatar/MyAvatar.h
+++ b/interface/src/avatar/MyAvatar.h
@@ -60,7 +60,9 @@ class MyAvatar : public Avatar {
/**jsdoc
* Your avatar is your in-world representation of you. The
+ *
+ *
+ * Property Type Description
+ * id
Uuid Entity ID.
+ *
+ * properties
{@link Entities.EntityProperties} Entity properties. MyAvatar
API is used to manipulate the avatar.
* For example, you can customize the avatar's appearance, run custom avatar animations,
- * change the avatar's position within the domain, or manage the avatar's collisions with other objects.
+ * change the avatar's position within the domain, or manage the avatar's collisions with the environment and other avatars.
+ *
+ * 0.005
+ * and 1000.0
. When getting, the value may temporarily be further limited by the domain's settings.
+ * @property {number} density - The density of the avatar in kg/m3. The density is used to work out its mass in
+ * the application of physics. Read-only.
+ * @property {Vec3} handPosition - A user-defined hand position, in world coordinates. The position moves with the avatar
+ * but is otherwise not used or changed by Interface.
* @property {number} bodyYaw - The rotation left or right about an axis running from the head to the feet of the avatar.
* Yaw is sometimes called "heading".
* @property {number} bodyPitch - The rotation about an axis running from shoulder to shoulder of the avatar. Pitch is
* sometimes called "elevation".
* @property {number} bodyRoll - The rotation about an axis running from the chest to the back of the avatar. Roll is
* sometimes called "bank".
- * @property {Quat} orientation
+ * @property {Quat} orientation - The orientation of the avatar.
* @property {Quat} headOrientation - The orientation of the avatar's head.
* @property {number} headPitch - The rotation about an axis running from ear to ear of the avatar's head. Pitch is
* sometimes called "elevation".
@@ -87,22 +92,31 @@ class MyAvatar : public Avatar {
* head. Yaw is sometimes called "heading".
* @property {number} headRoll - The rotation about an axis running from the nose to the back of the avatar's head. Roll is
* sometimes called "bank".
- * @property {Vec3} velocity
- * @property {Vec3} angularVelocity
- * @property {number} audioLoudness
- * @property {number} audioAverageLoudness
- * @property {string} displayName
- * @property {string} sessionDisplayName - Sanitized, defaulted version displayName that is defined by the AvatarMixer
- * rather than by Interface clients. The result is unique among all avatars present at the time.
- * @property {boolean} lookAtSnappingEnabled
- * @property {string} skeletonModelURL
- * @property {AttachmentData[]} attachmentData
+ * @property {Vec3} velocity - The current velocity of the avatar.
+ * @property {Vec3} angularVelocity - The current angular velocity of the avatar.
+ * @property {number} audioLoudness - The instantaneous loudness of the audio input that the avatar is injecting into the
+ * domain.
+ * @property {number} audioAverageLoudness - The rolling average loudness of the audio input that the avatar is injecting
+ * into the domain.
+ * @property {string} displayName - The avatar's display name.
+ * @property {string} sessionDisplayName - Sanitized, defaulted version of displayName
that is defined by the
+ * avatar mixer rather than by Interface clients. The result is unique among all avatars present in the domain at the
+ * time.
+ * @property {boolean} lookAtSnappingEnabled=true - If true
, the avatar's eyes snap to look at another avatar's
+ * eyes if generally in the line of sight and the other avatar also has lookAtSnappingEnabled == true
.
+ * @property {string} skeletonModelURL - The URL of the avatar model's .fst
file.
+ * @property {AttachmentData[]} attachmentData - Information on the attachments worn by the avatar.
+ * Deprecated: Use avatar entities instead.
* @property {string[]} jointNames - The list of joints in the current avatar model. Read-only.
- * @property {Uuid} sessionUUID Read-only.
- * @property {Mat4} sensorToWorldMatrix Read-only.
- * @property {Mat4} controllerLeftHandMatrix Read-only.
- * @property {Mat4} controllerRightHandMatrix Read-only.
- * @property {number} sensorToWorldScale Read-only.
+ * @property {Uuid} sessionUUID - Unique ID of the avatar in the domain. Read-only.
+ * @property {Mat4} sensorToWorldMatrix - The scale, rotation, and translation transform from the user's real world to the
+ * avatar's size, orientation, and position in the virtual world. Read-only.
+ * @property {Mat4} controllerLeftHandMatrix - The rotation and translation of the left hand controller relative to the
+ * avatar. Read-only.
+ * @property {Mat4} controllerRightHandMatrix - The rotation and translation of the right hand controller relative to the
+ * avatar. Read-only.
+ * @property {number} sensorToWorldScale - The scale that transforms dimensions in the user's real world to the avatar's
+ * size in the virtual world. Read-only.
*
* @comment IMPORTANT: This group of properties is copied from Avatar.h; they should NOT be edited here.
* @property {Vec3} skeletonOffset - Can be used to apply a translation offset between the avatar's position and the
@@ -124,9 +138,9 @@ class MyAvatar : public Avatar {
* by the audio mixer, so all audio effectively plays back at a 24khz. 48kHz RAW files are also supported.
* @property {number} audioListenerMode=0 - Specifies the listening position when hearing spatialized audio. Must be one
* of the following property values:
- * audioListenerModeHead
- * audioListenerModeCamera
- * audioListenerModeCustom
+ * Myavatar.audioListenerModeHead
+ * Myavatar.audioListenerModeCamera
+ * Myavatar.audioListenerModeCustom
* @property {number} audioListenerModeHead=0 - The audio listening position is at the avatar's head. Read-only.
* @property {number} audioListenerModeCamera=1 - The audio listening position is at the camera. Read-only.
* @property {number} audioListenerModeCustom=2 - The audio listening position is at a the position specified by set by the
@@ -135,10 +149,12 @@ class MyAvatar : public Avatar {
* property value is audioListenerModeCustom
.
* @property {Quat} customListenOrientation=Quat.IDENTITY - The listening orientation used when the
* audioListenerMode
property value is audioListenerModeCustom
.
- * @property {boolean} hasScriptedBlendshapes=false - Blendshapes will be transmitted over the network if set to true.
- * @property {boolean} hasProceduralBlinkFaceMovement=true - procedural blinking will be turned on if set to true.
- * @property {boolean} hasProceduralEyeFaceMovement=true - procedural eye movement will be turned on if set to true.
- * @property {boolean} hasAudioEnabledFaceMovement=true - If set to true, voice audio will move the mouth Blendshapes while MyAvatar.hasScriptedBlendshapes is enabled.
+ * @property {boolean} hasScriptedBlendshapes=false - Blendshapes will be transmitted over the network if set to true.
+ * Note: Currently doesn't work. Use {@link MyAvatar.setForceFaceTrackerConnected} instead.
+ * @property {boolean} hasProceduralBlinkFaceMovement=true - If true
then procedural blinking is turned on.
+ * @property {boolean} hasProceduralEyeFaceMovement=true - If true
then procedural eye movement is turned on.
+ * @property {boolean} hasAudioEnabledFaceMovement=true - If true
then voice audio will move the mouth
+ * blendshapes while MyAvatar.hasScriptedBlendshapes
is enabled.
* @property {number} rotationRecenterFilterLength
* @property {number} rotationThreshold
* @property {boolean} enableStepResetRotation
@@ -169,16 +185,18 @@ class MyAvatar : public Avatar {
* @property {boolean} hmdLeanRecenterEnabled=true - If true
then the avatar is re-centered to be under the
* head's position. In room-scale VR, this behavior is what causes your avatar to follow your HMD as you walk around
* the room. Setting the value false
is useful if you want to pin the avatar to a fixed position.
- * @property {boolean} collisionsEnabled - Set to true
to enable collisions for the avatar, false
- * to disable collisions. May return true
even though the value was set false
because the
- * zone may disallow collisionless avatars.
- * @property {boolean} otherAvatarsCollisionsEnabled
- * @property {boolean} characterControllerEnabled - Synonym of collisionsEnabled
.
+ * @property {boolean} collisionsEnabled - Set to true
to enable the avatar to collide with the environment,
+ * false
to disable collisions with the environment. May return true
even though the value
+ * was set false
because the zone may disallow collisionless avatars.
+ * @property {boolean} otherAvatarsCollisionsEnabled - Set to true
to enable the avatar to collide with other
+ * avatars, false
to disable collisions with other avatars.
+ * @property {boolean} characterControllerEnabled - Synonym of collisionsEnabled
.
* Deprecated: Use collisionsEnabled
instead.
* @property {boolean} useAdvancedMovementControls - Returns and sets the value of the Interface setting, Settings >
- * Walking and teleporting. Note: Setting the value has no effect unless Interface is restarted.
- * @property {boolean} showPlayArea - Returns and sets the value of the Interface setting, Settings > Show room boundaries
- * while teleporting. Note: Setting the value has no effect unless Interface is restarted.
+ * Controls > Walking. Note: Setting the value has no effect unless Interface is restarted.
+ * @property {boolean} showPlayArea - Returns and sets the value of the Interface setting, Settings > Controls > Show room
+ * boundaries while teleporting.
+ * Note: Setting the value has no effect unless Interface is restarted.
*
* @property {number} yawSpeed=75
* @property {number} pitchSpeed=50
@@ -187,8 +205,8 @@ class MyAvatar : public Avatar {
* while flying.
* @property {number} hmdRollControlDeadZone=8 - The amount of HMD roll, in degrees, required before your avatar turns if
* hmdRollControlEnabled
is enabled.
- * @property {number} hmdRollControlRate If hmdRollControlEnabled is true, this value determines the maximum turn rate of
- * your avatar when rolling your HMD in degrees per second.
+ * @property {number} hmdRollControlRate If MyAvatar.hmdRollControlEnabled
is true, this value determines the
+ * maximum turn rate of your avatar when rolling your HMD in degrees per second.
*
* @property {number} userHeight=1.75 - The height of the user in sensor space.
* @property {number} userEyeHeight=1.65 - The estimated height of the user's eyes in sensor space. Read-only.
@@ -237,8 +255,8 @@ class MyAvatar : public Avatar {
* @borrows Avatar.attach as attach
* @borrows Avatar.detachOne as detachOne
* @borrows Avatar.detachAll as detachAll
- * @borrows Avatar.getAvatarEntityData as getAvatarEntityData
- * @borrows Avatar.setAvatarEntityData as setAvatarEntityData
+ * @comment Avatar.getAvatarEntityData as getAvatarEntityData - Don't borrow because implementation is different.
+ * @comment Avatar.setAvatarEntityData as setAvatarEntityData - Don't borrow because implementation is different.
* @borrows Avatar.getSensorToWorldMatrix as getSensorToWorldMatrix
* @borrows Avatar.getSensorToWorldScale as getSensorToWorldScale
* @borrows Avatar.getControllerLeftHandMatrix as getControllerLeftHandMatrix
@@ -253,10 +271,10 @@ class MyAvatar : public Avatar {
* @borrows Avatar.sendAvatarDataPacket as sendAvatarDataPacket
* @borrows Avatar.sendIdentityPacket as sendIdentityPacket
* @borrows Avatar.setSessionUUID as setSessionUUID
- * @borrows Avatar.getAbsoluteJointRotationInObjectFrame as getAbsoluteJointRotationInObjectFrame
- * @borrows Avatar.getAbsoluteJointTranslationInObjectFrame as getAbsoluteJointTranslationInObjectFrame
- * @borrows Avatar.setAbsoluteJointRotationInObjectFrame as setAbsoluteJointRotationInObjectFrame
- * @borrows Avatar.setAbsoluteJointTranslationInObjectFrame as setAbsoluteJointTranslationInObjectFrame
+ * @comment Avatar.getAbsoluteJointRotationInObjectFrame as getAbsoluteJointRotationInObjectFrame - Don't borrow because implementation is different.
+ * @comment Avatar.getAbsoluteJointTranslationInObjectFrame as getAbsoluteJointTranslationInObjectFrame - Don't borrow because implementation is different.
+ * @comment Avatar.setAbsoluteJointRotationInObjectFrame as setAbsoluteJointRotationInObjectFrame - Don't borrow because implementation is different.
+ * @comment Avatar.setAbsoluteJointTranslationInObjectFrame as setAbsoluteJointTranslationInObjectFrame - Don't borrow because implementation is different.
* @borrows Avatar.getTargetScale as getTargetScale
* @borrows Avatar.resetLastSent as resetLastSent
*/
@@ -393,8 +411,9 @@ public:
/**jsdoc
- * The internal inverse-kinematics system maintains a record of which joints are "locked". Sometimes it is useful to forget this history, to prevent
- * contorted joints.
+ * Clears inverse kinematics joint limit history.
+ *
+ * Overrides the default avatar animations.
+ * overrideAnimation()
is used to
+ * completely override all motion from the default animation system (including inverse kinematics for hand and head
+ * controllers) and play a set of specified animations. To end these animations and restore the default animations, use
+ * {@link MyAvatar.restoreAnimation}.restoreAnimation()
is used to restore all motion from the default
+ * animation system including inverse kinematics for hand and head controllers. If you aren't currently playing an override
+ * animation, this function has no effect."idleStand"
, "idleTalk"
, or "walkFwd"
. getAnimationRoles()
+ * is used get the list of animation roles defined in the avatar-animation.json.
+ * Overrides a specific animation role.
+ * "idleStand"
, "idleTalk"
, or
+ * "walkFwd"
. To get the full list of roles, use {@ link MyAvatar.getAnimationRoles}.
+ * For each role, the avatar-animation.json defines when the animation is used, the animation clip (.FBX) used, and how
+ * animations are blended together with procedural data (such as look at vectors, hand sensors etc.).
+ * overrideRoleAnimation()
is used to change the animation clip (.FBX) associated with a specified animation
+ * role. To end the role animation and restore the default, use {@link MyAvatar.restoreRoleAnimation}."idleStand"
, "idleTalk"
, or
+ * "walkFwd"
. To get the full list of roles, use {#link MyAvatar.getAnimationRoles}. For each role,
+ * the avatar-animation.json defines when the animation is used, the animation clip (.FBX) used, and how animations are
+ * blended together with procedural data (such as look-at vectors, hand sensors etc.). You can change the animation clip
+ * (.FBX) associated with a specified animation role using {@link MyAvatar.overrideRoleAnimation}.
+ * restoreRoleAnimation()
is used to restore a specified animation role's default animation clip. If you have
+ * not specified an override animation for the specified role, this function has no effect.
* @function MyAvatar.restoreRoleAnimation
* @param role {string} The animation role clip to restore.
*/
@@ -599,6 +627,7 @@ public:
* @param {string} hand
*/
Q_INVOKABLE void setDominantHand(const QString& hand);
+
/**jsdoc
* @function MyAvatar.getDominantHand
* @returns {string}
@@ -610,6 +639,7 @@ public:
* @param {string} hand
*/
Q_INVOKABLE void setHmdAvatarAlignmentType(const QString& hand);
+
/**jsdoc
* @function MyAvatar.getHmdAvatarAlignmentType
* @returns {string}
@@ -617,45 +647,61 @@ public:
Q_INVOKABLE QString getHmdAvatarAlignmentType() const;
/**jsdoc
- * @function MyAvatar.setCenterOfGravityModelEnabled
- * @param {boolean} enabled
- */
+ * @function MyAvatar.setCenterOfGravityModelEnabled
+ * @param {boolean} enabled
+ */
Q_INVOKABLE void setCenterOfGravityModelEnabled(bool value) { _centerOfGravityModelEnabled = value; }
+
/**jsdoc
- * @function MyAvatar.getCenterOfGravityModelEnabled
- * @returns {boolean}
- */
+ * @function MyAvatar.getCenterOfGravityModelEnabled
+ * @returns {boolean}
+ */
Q_INVOKABLE bool getCenterOfGravityModelEnabled() const { return _centerOfGravityModelEnabled; }
/**jsdoc
* @function MyAvatar.setHMDLeanRecenterEnabled
* @param {boolean} enabled
*/
Q_INVOKABLE void setHMDLeanRecenterEnabled(bool value) { _hmdLeanRecenterEnabled = value; }
+
/**jsdoc
* @function MyAvatar.getHMDLeanRecenterEnabled
* @returns {boolean}
*/
Q_INVOKABLE bool getHMDLeanRecenterEnabled() const { return _hmdLeanRecenterEnabled; }
+
/**jsdoc
- * Request to enable hand touch effect globally
+ * Requests that the hand touch effect is disabled for your avatar. Any resulting change in the status of the hand touch
+ * effect will be signaled by {@link MyAvatar.shouldDisableHandTouchChanged}.
+ * true
if the avatar is keeping its center of gravity under its head position,
+ * false
if not.
*/
Q_INVOKABLE bool isRecenteringHorizontally() const;
@@ -753,7 +800,7 @@ public:
const MyHead* getMyHead() const;
/**jsdoc
- * Get the current position of the avatar's "Head" joint.
+ * Gets the current position of the avatar's "Head" joint.
* @function MyAvatar.getHeadPosition
* @returns {Vec3} The current position of the avatar's "Head" joint.
* @example
+ * Gets the position of the avatar's left hand as positioned by a hand controller (e.g., Oculus Touch or Vive).
*
+ * Gets the position of the avatar's right hand as positioned by a hand controller (e.g., Oculus Touch or Vive).
*
* valid
property will be
@@ -861,7 +909,7 @@ public:
Q_INVOKABLE controller::Pose getLeftHandPose() const;
/**jsdoc
- * Get the pose (position, rotation, velocity, and angular velocity) of the avatar's left hand as positioned by a
+ * Gets the pose (position, rotation, velocity, and angular velocity) of the avatar's left hand as positioned by a
* hand controller (e.g., Oculus Touch or Vive).
* valid
property will be
@@ -935,7 +983,7 @@ public:
Q_INVOKABLE void useFullAvatarURL(const QUrl& fullAvatarURL, const QString& modelName = QString());
/**jsdoc
- * Get the complete URL for the current avatar.
+ * Gets the complete URL for the current avatar.
* @function MyAvatar.getFullAvatarURLFromPreferences
* @returns {string} The full avatar model name.
* @example true
if your avatar is flying and not taking off or falling, otherwise
- * false
.
+ * @returns {boolean} true
if your avatar is flying and not taking off or falling, false
if not.
*/
Q_INVOKABLE bool isFlying();
/**jsdoc
- * Check whether your avatar is in the air or not.
+ * Checks whether your avatar is in the air or not.
* @function MyAvatar.isInAir
* @returns {boolean} true
if your avatar is taking off, flying, or falling, otherwise false
* because your avatar is on the ground.
@@ -1040,7 +1088,7 @@ public:
Q_INVOKABLE bool isInAir();
/**jsdoc
- * Set your preference for flying in your current desktop or HMD display mode. Note that your ability to fly also depends
+ * Sets your preference for flying in your current desktop or HMD display mode. Note that your ability to fly also depends
* on whether the domain you're in allows you to fly.
* @function MyAvatar.setFlyingEnabled
* @param {boolean} enabled - Set true
if you want to enable flying in your current desktop or HMD display
@@ -1049,7 +1097,7 @@ public:
Q_INVOKABLE void setFlyingEnabled(bool enabled);
/**jsdoc
- * Get your preference for flying in your current desktop or HMD display mode. Note that your ability to fly also depends
+ * Gets your preference for flying in your current desktop or HMD display mode. Note that your ability to fly also depends
* on whether the domain you're in allows you to fly.
* @function MyAvatar.getFlyingEnabled
* @returns {boolean} true
if your preference is to enable flying in your current desktop or HMD display mode,
@@ -1058,7 +1106,7 @@ public:
Q_INVOKABLE bool getFlyingEnabled();
/**jsdoc
- * Set your preference for flying in desktop display mode. Note that your ability to fly also depends on whether the domain
+ * Sets your preference for flying in desktop display mode. Note that your ability to fly also depends on whether the domain
* you're in allows you to fly.
* @function MyAvatar.setFlyingDesktopPref
* @param {boolean} enabled - Set true
if you want to enable flying in desktop display mode, otherwise set
@@ -1067,7 +1115,7 @@ public:
Q_INVOKABLE void setFlyingDesktopPref(bool enabled);
/**jsdoc
- * Get your preference for flying in desktop display mode. Note that your ability to fly also depends on whether the domain
+ * Gets your preference for flying in desktop display mode. Note that your ability to fly also depends on whether the domain
* you're in allows you to fly.
* @function MyAvatar.getFlyingDesktopPref
* @returns {boolean} true
if your preference is to enable flying in desktop display mode, otherwise
@@ -1076,7 +1124,7 @@ public:
Q_INVOKABLE bool getFlyingDesktopPref();
/**jsdoc
- * Set your preference for flying in HMD display mode. Note that your ability to fly also depends on whether the domain
+ * Sets your preference for flying in HMD display mode. Note that your ability to fly also depends on whether the domain
* you're in allows you to fly.
* @function MyAvatar.setFlyingHMDPref
* @param {boolean} enabled - Set true
if you want to enable flying in HMD display mode, otherwise set
@@ -1085,7 +1133,7 @@ public:
Q_INVOKABLE void setFlyingHMDPref(bool enabled);
/**jsdoc
- * Get your preference for flying in HMD display mode. Note that your ability to fly also depends on whether the domain
+ * Gets your preference for flying in HMD display mode. Note that your ability to fly also depends on whether the domain
* you're in allows you to fly.
* @function MyAvatar.getFlyingHMDPref
* @returns {boolean} true
if your preference is to enable flying in HMD display mode, otherwise
@@ -1120,38 +1168,53 @@ public:
Q_INVOKABLE bool getCollisionsEnabled();
/**jsdoc
- * @function MyAvatar.setOtherAvatarsCollisionsEnabled
- * @param {boolean} enabled
- */
+ * @function MyAvatar.setOtherAvatarsCollisionsEnabled
+ * @param {boolean} enabled
+ */
Q_INVOKABLE void setOtherAvatarsCollisionsEnabled(bool enabled);
/**jsdoc
- * @function MyAvatar.getOtherAvatarsCollisionsEnabled
- * @returns {boolean}
- */
+ * @function MyAvatar.getOtherAvatarsCollisionsEnabled
+ * @returns {boolean}
+ */
Q_INVOKABLE bool getOtherAvatarsCollisionsEnabled();
/**jsdoc
- * @function MyAvatar.getCollisionCapsule
- * @returns {object}
- */
+ * @function MyAvatar.getCollisionCapsule
+ * @returns {object}
+ */
Q_INVOKABLE QVariantMap getCollisionCapsule() const;
/**jsdoc
* @function MyAvatar.setCharacterControllerEnabled
* @param {boolean} enabled
- * @deprecated
+ * @deprecated Use {@link MyAvatar.setCollisionsEnabled} instead.
*/
Q_INVOKABLE void setCharacterControllerEnabled(bool enabled); // deprecated
/**jsdoc
* @function MyAvatar.getCharacterControllerEnabled
* @returns {boolean}
- * @deprecated
+ * @deprecated Use {@link MyAvatar.getCollisionsEnabled} instead.
*/
Q_INVOKABLE bool getCharacterControllerEnabled(); // deprecated
+ /**jsdoc
+ * @comment Different behavior to the Avatar version of this method.
+ * Gets the rotation of a joint relative to the avatar.
+ * @function MyAvatar.getAbsoluteJointRotationInObjectFrame
+ * @param {number} index - The index of the joint.
+ * @returns {Quat} The rotation of the joint relative to the avatar.
+ */
virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const override;
+
+ /**jsdoc
+ * @comment Different behavior to the Avatar version of this method.
+ * Gets the translation of a joint relative to the avatar.
+ * @function MyAvatar.getAbsoluteJointTranslationInObjectFrame
+ * @param {number} index - The index of the joint.
+ * @returns {Vec3} The translation of the joint relative to the avatar.
+ */
virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const override;
// all calibration matrices are in absolute sensor space.
@@ -1241,34 +1304,56 @@ public:
void prepareAvatarEntityDataForReload();
/**jsdoc
- * Create a new grab.
+ * Creates a new grab, that grabs an entity.
* @function MyAvatar.grab
- * @param {Uuid} targetID - id of grabbed thing
- * @param {number} parentJointIndex - avatar joint being used to grab
- * @param {Vec3} offset - target's positional offset from joint
- * @param {Quat} rotationalOffset - target's rotational offset from joint
- * @returns {Uuid} id of the new grab
+ * @param {Uuid} targetID - The ID of the entity to grab.
+ * @param {number} parentJointIndex - The avatar joint to use to grab the entity.
+ * @param {Vec3} offset - The target's local positional relative to the joint.
+ * @param {Quat} rotationalOffset - The target's local rotation relative to the joint.
+ * @returns {Uuid} The ID of the new grab.
*/
Q_INVOKABLE const QUuid grab(const QUuid& targetID, int parentJointIndex,
glm::vec3 positionalOffset, glm::quat rotationalOffset);
/**jsdoc
- * Release (delete) a grab.
+ * Releases (deletes) a grab, to stop grabbing an entity.
* @function MyAvatar.releaseGrab
- * @param {Uuid} grabID - id of grabbed thing
+ * @param {Uuid} grabID - The ID of the grab to release.
*/
Q_INVOKABLE void releaseGrab(const QUuid& grabID);
+ /**jsdoc
+ * Gets the avatar entities as binary data.
+ * @function MyAvatar.getAvatarEntityData
+ * @override
+ * @returns {AvatarEntityMap}
+ */
AvatarEntityMap getAvatarEntityData() const override;
+
+ /**jsdoc
+ * Sets the avatar entities from binary data.
+ * @function MyAvatar.setAvatarEntityData
+ * @param {AvatarEntityMap} avatarEntityData
+ */
void setAvatarEntityData(const AvatarEntityMap& avatarEntityData) override;
+
+ /**jsdoc
+ * @comment Uses the base class's JSDoc.
+ */
void updateAvatarEntity(const QUuid& entityID, const QByteArray& entityData) override;
+
void avatarEntityDataToJson(QJsonObject& root) const override;
+
+ /**jsdoc
+ * @function MyAvatar.sendAvatarDataPacket
+ * @param {boolean} sendAll
+ */
int sendAvatarDataPacket(bool sendAll = false) override;
public slots:
/**jsdoc
- * Increase the avatar's scale by five percent, up to a minimum scale of 1000
.
+ * Increases the avatar's scale by five percent, up to a minimum scale of 1000
.
* @function MyAvatar.increaseSize
* @example 0.25
.
+ * Decreases the avatar's scale by five percent, down to a minimum scale of 0.25
.
* @function MyAvatar.decreaseSize
* @example 1.0
.
+ * Resets the avatar's scale back to the default scale of 1.0
.
* @function MyAvatar.resetSize
*/
void resetSize();
@@ -1317,7 +1402,7 @@ public slots:
float getGravity();
/**jsdoc
- * Move the avatar to a new position and/or orientation in the domain, while taking into account Avatar leg-length.
+ * Moves the avatar to a new position and/or orientation in the domain, while taking into account Avatar leg-length.
* @function MyAvatar.goToFeetLocation
* @param {Vec3} position - The new position for the avatar, in world coordinates.
* @param {boolean} [hasOrientation=false] - Set to true
to set the orientation of the avatar.
@@ -1330,7 +1415,7 @@ public slots:
bool shouldFaceLocation);
/**jsdoc
- * Move the avatar to a new position and/or orientation in the domain.
+ * Moves the avatar to a new position and/or orientation in the domain.
* @function MyAvatar.goToLocation
* @param {Vec3} position - The new position for the avatar, in world coordinates.
* @param {boolean} [hasOrientation=false] - Set to true
to set the orientation of the avatar.
@@ -1395,61 +1480,70 @@ public slots:
/**jsdoc
- * ####### Why Q_INVOKABLE?
* @function MyAvatar.updateMotionBehaviorFromMenu
*/
Q_INVOKABLE void updateMotionBehaviorFromMenu();
/**jsdoc
- * @function MyAvatar.setToggleHips
- * @param {boolean} enabled
- */
+ * @function MyAvatar.setToggleHips
+ * @param {boolean} enabled
+ */
void setToggleHips(bool followHead);
+
/**jsdoc
- * @function MyAvatar.setEnableDebugDrawBaseOfSupport
- * @param {boolean} enabled
- */
+ * @function MyAvatar.setEnableDebugDrawBaseOfSupport
+ * @param {boolean} enabled
+ */
void setEnableDebugDrawBaseOfSupport(bool isEnabled);
+
/**jsdoc
* @function MyAvatar.setEnableDebugDrawDefaultPose
* @param {boolean} enabled
*/
void setEnableDebugDrawDefaultPose(bool isEnabled);
+
/**jsdoc
* @function MyAvatar.setEnableDebugDrawAnimPose
* @param {boolean} enabled
*/
void setEnableDebugDrawAnimPose(bool isEnabled);
+
/**jsdoc
* @function MyAvatar.setEnableDebugDrawPosition
* @param {boolean} enabled
*/
void setEnableDebugDrawPosition(bool isEnabled);
+
/**jsdoc
* @function MyAvatar.setEnableDebugDrawHandControllers
* @param {boolean} enabled
*/
void setEnableDebugDrawHandControllers(bool isEnabled);
+
/**jsdoc
* @function MyAvatar.setEnableDebugDrawSensorToWorldMatrix
* @param {boolean} enabled
*/
void setEnableDebugDrawSensorToWorldMatrix(bool isEnabled);
+
/**jsdoc
* @function MyAvatar.setEnableDebugDrawIKTargets
* @param {boolean} enabled
*/
void setEnableDebugDrawIKTargets(bool isEnabled);
+
/**jsdoc
* @function MyAvatar.setEnableDebugDrawIKConstraints
* @param {boolean} enabled
*/
void setEnableDebugDrawIKConstraints(bool isEnabled);
+
/**jsdoc
* @function MyAvatar.setEnableDebugDrawIKChains
* @param {boolean} enabled
*/
void setEnableDebugDrawIKChains(bool isEnabled);
+
/**jsdoc
* @function MyAvatar.setEnableDebugDrawDetailedCollision
* @param {boolean} enabled
@@ -1457,23 +1551,20 @@ public slots:
void setEnableDebugDrawDetailedCollision(bool isEnabled);
/**jsdoc
- * Get whether or not your avatar mesh is visible.
+ * Gets whether or not your avatar mesh is visible.
* @function MyAvatar.getEnableMeshVisible
* @returns {boolean} true
if your avatar's mesh is visible, otherwise false
.
*/
bool getEnableMeshVisible() const override;
/**jsdoc
- * ####### TODO; Should this really be exposed in the API?
* @function MyAvatar.storeAvatarEntityDataPayload
+ * @deprecated This function is deprecated and will be removed.
*/
void storeAvatarEntityDataPayload(const QUuid& entityID, const QByteArray& payload) override;
/**jsdoc
- * ####### Does override change functionality? If so, document here and don't borrow; if not, borrow and don't document here.
- * @function MyAvatar.clearAvatarEntity
- * @param {Uuid} entityID
- * @param {boolean} [requiresRemovalFromTree]
+ * @comment Uses the base class's JSDoc.
*/
void clearAvatarEntity(const QUuid& entityID, bool requiresRemovalFromTree = true) override;
@@ -1483,7 +1574,7 @@ public slots:
void sanitizeAvatarEntityProperties(EntityItemProperties& properties) const;
/**jsdoc
- * Set whether or not your avatar mesh is visible.
+ * Sets whether or not your avatar mesh is visible.
* @function MyAvatar.setEnableMeshVisible
* @param {boolean} visible - true
to set your avatar mesh visible; false
to set it invisible.
* @example true
if collisions with the environment are enabled, false
if
+ * they're not.
* @returns {Signal}
*/
void collisionsEnabledChanged(bool enabled);
/**jsdoc
- * Triggered when collisions with other avatars enabled or disabled
+ * Triggered when collisions with other avatars are enabled or disabled.
* @function MyAvatar.otherAvatarsCollisionsEnabledChanged
- * @param {boolean} enabled
+ * @param {boolean} enabled - true
if collisions with other avatars are enabled, false
if they're
+ * not.
* @returns {Signal}
*/
void otherAvatarsCollisionsEnabledChanged(bool enabled);
/**jsdoc
- * Triggered when avatar's animation url changes
+ * Triggered when the avatar's animation changes.
* @function MyAvatar.animGraphUrlChanged
- * @param {url} url
+ * @param {url} url - The URL of the new animation.
* @returns {Signal}
*/
void animGraphUrlChanged(const QUrl& url);
@@ -1672,18 +1765,24 @@ signals:
void scaleChanged();
/**jsdoc
- * Triggered when hand touch is globally enabled or disabled
+ * Triggered when the hand touch effect is enabled or disabled for the avatar.
+ * true
if the hand touch effect is disabled for the avatar,
+ * false
if it isn't disabled.
* @returns {Signal}
*/
void shouldDisableHandTouchChanged(bool shouldDisable);
/**jsdoc
- * Triggered when hand touch is enabled or disabled for an specific entity
+ * Triggered when the hand touch is enabled or disabled on a specific entity.
+ * true
if the hand touch effect is disabled for the entity,
+ * false
if it isn't disabled.
* @returns {Signal}
*/
void disableHandTouchForIDChanged(const QUuid& entityID, bool disable);
diff --git a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h
index 98aa255641..11940ad76a 100644
--- a/libraries/avatars-renderer/src/avatars-renderer/Avatar.h
+++ b/libraries/avatars-renderer/src/avatars-renderer/Avatar.h
@@ -215,17 +215,17 @@ public:
Q_INVOKABLE virtual glm::vec3 getDefaultJointTranslation(int index) const;
/**jsdoc
- * Provides read only access to the default joint rotations in avatar coordinates.
+ * Provides read-only access to the default joint rotations in avatar coordinates.
* The default pose of the avatar is defined by the position and orientation of all bones
* in the avatar's model file. Typically this is a T-pose.
* @function MyAvatar.getAbsoluteDefaultJointRotationInObjectFrame
- * @param index {number} -The joint index.
+ * @param index {number} - The joint index.
* @returns {Quat} The rotation of this joint in avatar coordinates.
*/
Q_INVOKABLE virtual glm::quat getAbsoluteDefaultJointRotationInObjectFrame(int index) const;
/**jsdoc
- * Provides read only access to the default joint translations in avatar coordinates.
+ * Provides read-only access to the default joint translations in avatar coordinates.
* The default pose of the avatar is defined by the position and orientation of all bones
* in the avatar's model file. Typically this is a T-pose.
* @function MyAvatar.getAbsoluteDefaultJointTranslationInObjectFrame
@@ -261,52 +261,51 @@ public:
// world-space to avatar-space rigconversion functions
/**jsdoc
- * @function MyAvatar.worldToJointPoint
- * @param {Vec3} position
- * @param {number} [jointIndex=-1]
- * @returns {Vec3}
- */
+ * @function MyAvatar.worldToJointPoint
+ * @param {Vec3} position
+ * @param {number} [jointIndex=-1]
+ * @returns {Vec3}
+ */
Q_INVOKABLE glm::vec3 worldToJointPoint(const glm::vec3& position, const int jointIndex = -1) const;
/**jsdoc
- * @function MyAvatar.worldToJointDirection
- * @param {Vec3} direction
- * @param {number} [jointIndex=-1]
- * @returns {Vec3}
- */
+ * @function MyAvatar.worldToJointDirection
+ * @param {Vec3} direction
+ * @param {number} [jointIndex=-1]
+ * @returns {Vec3}
+ */
Q_INVOKABLE glm::vec3 worldToJointDirection(const glm::vec3& direction, const int jointIndex = -1) const;
/**jsdoc
- * @function MyAvatar.worldToJointRotation
- * @param {Quat} rotation
- * @param {number} [jointIndex=-1]
- * @returns {Quat}
+ * @function MyAvatar.worldToJointRotation
+ * @param {Quat} rotation
+ * @param {number} [jointIndex=-1]
+ * @returns {Quat}
*/
Q_INVOKABLE glm::quat worldToJointRotation(const glm::quat& rotation, const int jointIndex = -1) const;
-
/**jsdoc
- * @function MyAvatar.jointToWorldPoint
- * @param {vec3} position
- * @param {number} [jointIndex=-1]
- * @returns {Vec3}
- */
+ * @function MyAvatar.jointToWorldPoint
+ * @param {vec3} position
+ * @param {number} [jointIndex=-1]
+ * @returns {Vec3}
+ */
Q_INVOKABLE glm::vec3 jointToWorldPoint(const glm::vec3& position, const int jointIndex = -1) const;
/**jsdoc
- * @function MyAvatar.jointToWorldDirection
- * @param {Vec3} direction
- * @param {number} [jointIndex=-1]
- * @returns {Vec3}
- */
+ * @function MyAvatar.jointToWorldDirection
+ * @param {Vec3} direction
+ * @param {number} [jointIndex=-1]
+ * @returns {Vec3}
+ */
Q_INVOKABLE glm::vec3 jointToWorldDirection(const glm::vec3& direction, const int jointIndex = -1) const;
/**jsdoc
- * @function MyAvatar.jointToWorldRotation
- * @param {Quat} rotation
- * @param {number} [jointIndex=-1]
- * @returns {Quat}
- */
+ * @function MyAvatar.jointToWorldRotation
+ * @param {Quat} rotation
+ * @param {number} [jointIndex=-1]
+ * @returns {Quat}
+ */
Q_INVOKABLE glm::quat jointToWorldRotation(const glm::quat& rotation, const int jointIndex = -1) const;
virtual void setSkeletonModelURL(const QUrl& skeletonModelURL) override;
@@ -321,7 +320,7 @@ public:
float radius1, float radius2, const glm::vec4& color);
/**jsdoc
- * Set the offset applied to the current avatar. The offset adjusts the position that the avatar is rendered. For example,
+ * Sets the offset applied to the current avatar. The offset adjusts the position that the avatar is rendered. For example,
* with an offset of { x: 0, y: 0.1, z: 0 }
, your avatar will appear to be raised off the ground slightly.
* @function MyAvatar.setSkeletonOffset
* @param {Vec3} offset - The skeleton offset to set.
@@ -337,7 +336,7 @@ public:
Q_INVOKABLE void setSkeletonOffset(const glm::vec3& offset);
/**jsdoc
- * Get the offset applied to the current avatar. The offset adjusts the position that the avatar is rendered. For example,
+ * Gets the offset applied to the current avatar. The offset adjusts the position that the avatar is rendered. For example,
* with an offset of { x: 0, y: 0.1, z: 0 }
, your avatar will appear to be raised off the ground slightly.
* @function MyAvatar.getSkeletonOffset
* @returns {Vec3} The current skeleton offset.
@@ -349,7 +348,7 @@ public:
virtual glm::vec3 getSkeletonPosition() const;
/**jsdoc
- * Get the position of a joint in the current avatar.
+ * Gets the position of a joint in the current avatar.
* @function MyAvatar.getJointPosition
* @param {number} index - The index of the joint.
* @returns {Vec3} The position of the joint in world coordinates.
@@ -357,7 +356,7 @@ public:
Q_INVOKABLE glm::vec3 getJointPosition(int index) const;
/**jsdoc
- * Get the position of a joint in the current avatar.
+ * Gets the position of a joint in the current avatar.
* @function MyAvatar.getJointPosition
* @param {string} name - The name of the joint.
* @returns {Vec3} The position of the joint in world coordinates.
@@ -367,7 +366,7 @@ public:
Q_INVOKABLE glm::vec3 getJointPosition(const QString& name) const;
/**jsdoc
- * Get the position of the current avatar's neck in world coordinates.
+ * Gets the position of the current avatar's neck in world coordinates.
* @function MyAvatar.getNeckPosition
* @returns {Vec3} The position of the neck in world coordinates.
* @example true
if "warn when muted" is enabled, otherwise false
.
+ * @returns {Signal}
+ */
+ void warnWhenMutedChanged(bool isEnabled);
+
/**jsdoc
* Triggered when the input audio volume changes.
* @function Audio.inputVolumeChanged
@@ -248,6 +258,7 @@ public slots:
private slots:
void setMuted(bool muted);
void enableNoiseReduction(bool enable);
+ void enableWarnWhenMuted(bool enable);
void setInputVolume(float volume);
void onInputLoudnessChanged(float loudness, bool isClipping);
@@ -262,6 +273,7 @@ private:
bool _isClipping { false };
bool _isMuted { false };
bool _enableNoiseReduction { true }; // Match default value of AudioClient::_isNoiseGateEnabled.
+ bool _enableWarnWhenMuted { true };
bool _contextIsHMD { false };
AudioDevices* getDevices() { return &_devices; }
AudioDevices _devices;
diff --git a/libraries/audio-client/src/AudioClient.cpp b/libraries/audio-client/src/AudioClient.cpp
index 8c50a195ee..1c10d24f23 100644
--- a/libraries/audio-client/src/AudioClient.cpp
+++ b/libraries/audio-client/src/AudioClient.cpp
@@ -1531,6 +1531,14 @@ void AudioClient::setNoiseReduction(bool enable, bool emitSignal) {
}
}
+void AudioClient::setWarnWhenMuted(bool enable, bool emitSignal) {
+ if (_warnWhenMuted != enable) {
+ _warnWhenMuted = enable;
+ if (emitSignal) {
+ emit warnWhenMutedChanged(_warnWhenMuted);
+ }
+ }
+}
bool AudioClient::setIsStereoInput(bool isStereoInput) {
bool stereoInputChanged = false;
diff --git a/libraries/audio-client/src/AudioClient.h b/libraries/audio-client/src/AudioClient.h
index 29036b7c71..6d3483b0f8 100644
--- a/libraries/audio-client/src/AudioClient.h
+++ b/libraries/audio-client/src/AudioClient.h
@@ -210,6 +210,9 @@ public slots:
void setNoiseReduction(bool isNoiseGateEnabled, bool emitSignal = true);
bool isNoiseReductionEnabled() const { return _isNoiseGateEnabled; }
+ void setWarnWhenMuted(bool isNoiseGateEnabled, bool emitSignal = true);
+ bool isWarnWhenMutedEnabled() const { return _warnWhenMuted; }
+
bool getLocalEcho() { return _shouldEchoLocally; }
void setLocalEcho(bool localEcho) { _shouldEchoLocally = localEcho; }
void toggleLocalEcho() { _shouldEchoLocally = !_shouldEchoLocally; }
@@ -246,6 +249,7 @@ signals:
void inputVolumeChanged(float volume);
void muteToggled(bool muted);
void noiseReductionChanged(bool noiseReductionEnabled);
+ void warnWhenMutedChanged(bool warnWhenMutedEnabled);
void mutedByMixer();
void inputReceived(const QByteArray& inputSamples);
void inputLoudnessChanged(float loudness, bool isClipping);
@@ -365,6 +369,7 @@ private:
bool _shouldEchoLocally;
bool _shouldEchoToServer;
bool _isNoiseGateEnabled;
+ bool _warnWhenMuted;
bool _reverb;
AudioEffectOptions _scriptReverbOptions;
diff --git a/scripts/system/audioMuteOverlay.js b/scripts/system/audioMuteOverlay.js
index 14ac96c8c6..d759b7d885 100644
--- a/scripts/system/audioMuteOverlay.js
+++ b/scripts/system/audioMuteOverlay.js
@@ -17,68 +17,104 @@
(function() { // BEGIN LOCAL_SCOPE
- var lastInputLoudness = 0.0;
- var sampleRate = 8.0; // Hz
- var attackTC = Math.exp(-1.0 / (sampleRate * 0.500)) // 500 milliseconds attack
- var releaseTC = Math.exp(-1.0 / (sampleRate * 1.000)) // 1000 milliseconds release
- var holdReset = 2.0 * sampleRate; // 2 seconds hold
- var holdCount = 0;
- var warningOverlayID = null;
+ var lastInputLoudness = 0.0;
+ var sampleRate = 8.0; // Hz
+ var attackTC = Math.exp(-1.0 / (sampleRate * 0.500)); // 500 milliseconds attack
+ var releaseTC = Math.exp(-1.0 / (sampleRate * 1.000)); // 1000 milliseconds release
+ var holdReset = 2.0 * sampleRate; // 2 seconds hold
+ var holdCount = 0;
+ var warningOverlayID = null;
+ var pollInterval = null;
+ var warningText = "Muted";
+ var textDimensions = { x: 100, y: 50 };
- function showWarning() {
- if (warningOverlayID) {
- return;
- }
- warningOverlayID = Overlays.addOverlay("text3d", {
- name: "Muted-Warning",
- localPosition: { x: 0.2, y: -0.35, z: -1.0 },
- localOrientation: Quat.fromVec3Degrees({ x: 0.0, y: 0.0, z: 0.0, w: 1.0 }),
- text: "Warning: you are muted",
- textAlpha: 1,
- color: { red: 226, green: 51, blue: 77 },
- backgroundAlpha: 0,
- lineHeight: 0.042,
- visible: true,
- ignoreRayIntersection: true,
- drawInFront: true,
- grabbable: false,
- parentID: MyAvatar.SELF_ID,
- parentJointIndex: MyAvatar.getJointIndex("_CAMERA_MATRIX")
- });
- };
+ function showWarning() {
+ if (warningOverlayID) {
+ return;
+ }
- function hideWarning() {
- if (!warningOverlayID) {
- return;
- }
- Overlays.deleteOverlay(warningOverlayID);
- warningOverlayID = null;
- }
+ var windowWidth;
+ var windowHeight;
+ if (HMD.active) {
+ var viewportDimension = Controller.getViewportDimensions();
+ windowWidth = viewportDimension.x;
+ windowHeight = viewportDimension.y;
+ } else {
+ windowWidth = Window.innerWidth;
+ windowHeight = Window.innerHeight;
+ }
- function cleanup() {
- Overlays.deleteOverlay(warningOverlayID);
- }
+ warningOverlayID = Overlays.addOverlay("text", {
+ name: "Muted-Warning",
+ font: { size: 36 },
+ text: warningText,
+ x: windowWidth / 2 - textDimensions.x / 2,
+ y: windowHeight / 2 - textDimensions.y / 2,
+ width: textDimensions.x,
+ height: textDimensions.y,
+ textColor: { red: 226, green: 51, blue: 77 },
+ backgroundAlpha: 0,
+ visible: true
+ });
+ }
- Script.scriptEnding.connect(cleanup);
+ function hideWarning() {
+ if (!warningOverlayID) {
+ return;
+ }
+ Overlays.deleteOverlay(warningOverlayID);
+ warningOverlayID = null;
+ }
- Script.setInterval(function() {
+ function startPoll() {
+ if (pollInterval) {
+ return;
+ }
+ pollInterval = Script.setInterval(function() {
+ var inputLoudness = Audio.inputLevel;
+ var tc = (inputLoudness > lastInputLoudness) ? attackTC : releaseTC;
+ inputLoudness += tc * (lastInputLoudness - inputLoudness);
+ lastInputLoudness = inputLoudness;
- var inputLoudness = Audio.inputLevel;
- var tc = (inputLoudness > lastInputLoudness) ? attackTC : releaseTC;
- inputLoudness += tc * (lastInputLoudness - inputLoudness);
- lastInputLoudness = inputLoudness;
+ if (inputLoudness > 0.1) {
+ holdCount = holdReset;
+ } else {
+ holdCount = Math.max(holdCount - 1, 0);
+ }
- if (Audio.muted && inputLoudness > 0.3) {
- holdCount = holdReset;
- } else {
- holdCount = Math.max(holdCount - 1, 0);
- }
+ if (holdCount > 0) {
+ showWarning();
+ } else {
+ hideWarning();
+ }
+ }, 1000.0 / sampleRate);
+ }
- if (holdCount > 0) {
- showWarning();
- } else {
- hideWarning();
- }
- }, 1000.0 / sampleRate);
+ function stopPoll() {
+ if (!pollInterval) {
+ return;
+ }
+ Script.clearInterval(pollInterval);
+ pollInterval = null;
+ hideWarning();
+ }
+
+ function startOrStopPoll() {
+ if (Audio.warnWhenMuted && Audio.muted) {
+ startPoll();
+ } else {
+ stopPoll();
+ }
+ }
+
+ function cleanup() {
+ stopPoll();
+ }
+
+ Script.scriptEnding.connect(cleanup);
+
+ startOrStopPoll();
+ Audio.mutedChanged.connect(startOrStopPoll);
+ Audio.warnWhenMutedChanged.connect(startOrStopPoll);
}()); // END LOCAL_SCOPE
From 76aa6fb1b9a7416c6c8858c7fc9537a48ff6d14a Mon Sep 17 00:00:00 2001
From: Seth Alves true
if the audio input is muted for desktop mode, otherwise false
.
+ * @returns {Signal}
+ */
+ void desktopMutedChanged(bool isMuted);
+
+ /**jsdoc
+ * Triggered when HMD audio input is muted or unmuted.
+ * @function Audio.hmdMutedChanged
+ * @param {boolean} isMuted - true
if the audio input is muted for HMD mode, otherwise false
.
+ * @returns {Signal}
+ */
+ void hmdMutedChanged(bool isMuted);
+
+ /**
+ * Triggered when Push-to-Talk has been enabled or disabled.
+ * @function Audio.pushToTalkChanged
+ * @param {boolean} enabled - true
if Push-to-Talk is enabled, otherwise false
.
+ * @returns {Signal}
+ */
+ void pushToTalkChanged(bool enabled);
+
+ /**
+ * Triggered when Push-to-Talk has been enabled or disabled for desktop mode.
+ * @function Audio.pushToTalkDesktopChanged
+ * @param {boolean} enabled - true
if Push-to-Talk is emabled for Desktop mode, otherwise false
.
+ * @returns {Signal}
+ */
+ void pushToTalkDesktopChanged(bool enabled);
+
+ /**
+ * Triggered when Push-to-Talk has been enabled or disabled for HMD mode.
+ * @function Audio.pushToTalkHMDChanged
+ * @param {boolean} enabled - true
if Push-to-Talk is emabled for HMD mode, otherwise false
.
+ * @returns {Signal}
+ */
+ void pushToTalkHMDChanged(bool enabled);
+
/**jsdoc
* Triggered when the audio input noise reduction is enabled or disabled.
* @function Audio.noiseReductionChanged
@@ -237,6 +306,14 @@ signals:
*/
void contextChanged(const QString& context);
+ /**jsdoc
+ * Triggered when pushing to talk.
+ * @function Audio.pushingToTalkChanged
+ * @param {boolean} talking - true
if broadcasting with PTT, false
otherwise.
+ * @returns {Signal}
+ */
+ void pushingToTalkChanged(bool talking);
+
public slots:
/**jsdoc
@@ -245,6 +322,8 @@ public slots:
*/
void onContextChanged();
+ void handlePushedToTalk(bool enabled);
+
private slots:
void setMuted(bool muted);
void enableNoiseReduction(bool enable);
@@ -260,11 +339,19 @@ private:
float _inputVolume { 1.0f };
float _inputLevel { 0.0f };
bool _isClipping { false };
- bool _isMuted { false };
bool _enableNoiseReduction { true }; // Match default value of AudioClient::_isNoiseGateEnabled.
bool _contextIsHMD { false };
AudioDevices* getDevices() { return &_devices; }
AudioDevices _devices;
+ Setting::Handletrue
if the audio input is muted for desktop mode, otherwise false
.
+ * @returns {Signal}
+ */
+ void desktopMutedChanged(bool isMuted);
+
+ /**jsdoc
+ * Triggered when HMD audio input is muted or unmuted.
+ * @function Audio.hmdMutedChanged
+ * @param {boolean} isMuted - true
if the audio input is muted for HMD mode, otherwise false
.
+ * @returns {Signal}
+ */
+ void hmdMutedChanged(bool isMuted);
+
+ /**
+ * Triggered when Push-to-Talk has been enabled or disabled.
+ * @function Audio.pushToTalkChanged
+ * @param {boolean} enabled - true
if Push-to-Talk is enabled, otherwise false
.
+ * @returns {Signal}
+ */
+ void pushToTalkChanged(bool enabled);
+
+ /**
+ * Triggered when Push-to-Talk has been enabled or disabled for desktop mode.
+ * @function Audio.pushToTalkDesktopChanged
+ * @param {boolean} enabled - true
if Push-to-Talk is emabled for Desktop mode, otherwise false
.
+ * @returns {Signal}
+ */
+ void pushToTalkDesktopChanged(bool enabled);
+
+ /**
+ * Triggered when Push-to-Talk has been enabled or disabled for HMD mode.
+ * @function Audio.pushToTalkHMDChanged
+ * @param {boolean} enabled - true
if Push-to-Talk is emabled for HMD mode, otherwise false
.
+ * @returns {Signal}
+ */
+ void pushToTalkHMDChanged(bool enabled);
+
/**jsdoc
* Triggered when the audio input noise reduction is enabled or disabled.
* @function Audio.noiseReductionChanged
@@ -237,6 +306,14 @@ signals:
*/
void contextChanged(const QString& context);
+ /**jsdoc
+ * Triggered when pushing to talk.
+ * @function Audio.pushingToTalkChanged
+ * @param {boolean} talking - true
if broadcasting with PTT, false
otherwise.
+ * @returns {Signal}
+ */
+ void pushingToTalkChanged(bool talking);
+
public slots:
/**jsdoc
@@ -245,6 +322,8 @@ public slots:
*/
void onContextChanged();
+ void handlePushedToTalk(bool enabled);
+
private slots:
void setMuted(bool muted);
void enableNoiseReduction(bool enable);
@@ -260,11 +339,19 @@ private:
float _inputVolume { 1.0f };
float _inputLevel { 0.0f };
bool _isClipping { false };
- bool _isMuted { false };
bool _enableNoiseReduction { true }; // Match default value of AudioClient::_isNoiseGateEnabled.
bool _contextIsHMD { false };
AudioDevices* getDevices() { return &_devices; }
AudioDevices _devices;
+ Setting::HandleHifiAbout
API provides information about the version of Interface that is currently running. It also
- * provides the ability to open a Web page in an Interface browser window.
+ * The HifiAbout
API provides information about the version of Interface that is currently running. It also
+ * has the functionality to open a web page in an Interface browser window.
*
* @namespace HifiAbout
*
@@ -30,9 +30,9 @@
* @property {string} qtVersion - The Qt version used in Interface that is currently running. Read-only.
*
* @example
*
*
- * Value Meaning Description
- * 0
Not logged in The user isn't logged in.
+ * 1
Not set up The user's wallet isn't set up.
+ * 0
Not logged in The user is not logged in.
* 1
Not set up The user's wallet has not been set up.
* 2
Pre-existing There is a wallet present on the server but not one
* locally. 3
Conflicting There is a wallet present on the server plus one present locally,
@@ -73,8 +73,8 @@ public:
*
*
*
- * 5
Ready The wallet is ready for use. AccountServices
API provides functions related to user connectivity, visibility, and asset download
- * progress.
+ * The AccountServices
API provides functions that give information on user connectivity, visibility, and
+ * asset download progress.
*
* @hifi-interface
* @hifi-client-entity
* @hifi-avatar
*
* @namespace AccountServices
- * @property {string} username - The user name if the user is logged in, otherwise "Unknown user"
.
- * Read-only.
+ * @property {string} username - The user name of the user logged in. If there is no user logged in, it is
+ * "Unknown user"
. Read-only.
* @property {boolean} loggedIn - true
if the user is logged in, otherwise false
.
* Read-only.
- * @property {string} findableBy - The user's visibility to other people:
+ * @property {string} findableBy - The user's visibility to other users:
* "none"
- user appears offline.
* "friends"
- user is visible only to friends.
* "connections"
- user is visible to friends and connections.
@@ -74,23 +74,23 @@ public:
public slots:
/**jsdoc
- * Get information on the progress of downloading assets in the domain.
+ * Gets information on the download progress of assets in the domain.
* @function AccountServices.getDownloadInfo
- * @returns {AccountServices.DownloadInfoResult} Information on the progress of assets download.
+ * @returns {AccountServices.DownloadInfoResult} Information on the download progress of assets.
*/
DownloadInfoResult getDownloadInfo();
/**jsdoc
- * Cause a {@link AccountServices.downloadInfoChanged|downloadInfoChanged} signal to be triggered with information on the
- * current progress of the download of assets in the domain.
+ * Triggers a {@link AccountServices.downloadInfoChanged|downloadInfoChanged} signal with information on the current
+ * download progress of the assets in the domain.
* @function AccountServices.updateDownloadInfo
*/
void updateDownloadInfo();
/**jsdoc
- * Check whether the user is logged in.
+ * Checks whether the user is logged in.
* @function AccountServices.isLoggedIn
- * @returns {boolean} true
if the user is logged in, false
otherwise.
+ * @returns {boolean} true
if the user is logged in, false
if not.
* @example true
if the user is already logged in, false
otherwise.
+ * @returns {boolean} true
if the user is logged in, false
if not.
*/
bool checkAndSignalForAccessToken();
@@ -140,7 +140,7 @@ signals:
/**jsdoc
* Triggered when the username logged in with changes, i.e., when the user logs in or out.
* @function AccountServices.myUsernameChanged
- * @param {string} username - The username logged in with if the user is logged in, otherwise ""
.
+ * @param {string} username - The user name of the user logged in. If there is no user logged in, it is ""
.
* @returns {Signal}
* @example true
if the user is logged in, otherwise false
.
+ * @param {boolean} loggedIn - true
if the user is logged in, false
if not.
* @returns {Signal}
* @example true
if Interface is running in limited commerce mode. In limited commerce
- * mode, certain Interface functionality is disabled, e.g., users can't buy non-free items from the Marketplace. The Oculus
- * Store version of Interface runs in limited commerce mode. Read-only.
+ * mode, certain Interface functionalities are disabled, e.g., users can't buy items that are not free from the Marketplace.
+ * The Oculus Store version of Interface runs in limited commerce mode. Read-only.
*/
class WalletScriptingInterface : public QObject, public Dependency {
Q_OBJECT
@@ -55,16 +55,16 @@ public:
WalletScriptingInterface();
/**jsdoc
- * Check and update the user's wallet status.
+ * Checks and updates the user's wallet status.
* @function WalletScriptingInterface.refreshWalletStatus
*/
Q_INVOKABLE void refreshWalletStatus();
/**jsdoc
- * Get the current status of the user's wallet.
+ * Gets the current status of the user's wallet.
* @function WalletScriptingInterface.getWalletStatus
* @returns {WalletScriptingInterface.WalletStatus}
- * @example
- * Warning: Neither of these signals fire if the entity is not an avatar entity or it's not a certified
- * entity.
+ * Warning: Neither of these signals are triggered if the entity is not an avatar entity or is not
+ * certified.
* @function WalletScriptingInterface.proveAvatarEntityOwnershipVerification
- * @param {Uuid} entityID - The ID of the avatar entity to check.
- * @example