diff --git a/assignment-client/src/avatars/ScriptableAvatar.h b/assignment-client/src/avatars/ScriptableAvatar.h
index 3cf10cc129..2d8dce23de 100644
--- a/assignment-client/src/avatars/ScriptableAvatar.h
+++ b/assignment-client/src/avatars/ScriptableAvatar.h
@@ -22,23 +22,27 @@
* The 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 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();