16
16
17
17
#include " Avatar.h"
18
18
19
+ /* *jsdoc
20
+ * Information about an avatar.
21
+ *
22
+ * <p>Created using {@link MyAvatar.getTargetAvatar} or {@link AvatarList.getAvatar}.</p>
23
+ *
24
+ * @class ScriptAvatar
25
+ * @hideconstructor
26
+ *
27
+ * @hifi-interface
28
+ * @hifi-client-entity
29
+ * @hifi-avatar
30
+ * @hifi-assignment-client
31
+ * @hifi-server-entity
32
+ *
33
+ * @property {Vec3} position - The avatar's position.
34
+ * @property {number} scale - The target scale of the avatar without any restrictions on permissible values imposed by the
35
+ * domain.
36
+ * @property {Vec3} handPosition - A user-defined hand position, in world coordinates. The position moves with the avatar but
37
+ * is otherwise not used or changed by Interface.
38
+ * @property {number} bodyPitch - The pitch of the avatar's body, in degrees.
39
+ * @property {number} bodyYaw - The yaw of the avatar's body, in degrees.
40
+ * @property {number} bodyRoll - The roll of the avatar's body, in degrees.
41
+ * @property {Quat} orientation - The orientation of the avatar's body.
42
+ * @property {Quat} headOrientation - The orientation of the avatar's head.
43
+ * @property {number} headPitch - The pitch of the avatar's head relative to the body, in degrees.
44
+ * @property {number} headYaw - The yaw of the avatar's head relative to the body, in degrees.
45
+ * @property {number} headRoll - The roll of the avatar's head relative to the body, in degrees.
46
+ *
47
+ * @property {Vec3} velocity - The linear velocity of the avatar.
48
+ * @property {Vec3} angularVelocity - The angular velocity of the avatar.
49
+ *
50
+ * @property {Uuid} sessionUUID - The avatar's session ID.
51
+ * @property {string} displayName - The avatar's display name.
52
+ * @property {string} sessionDisplayName - The avatar's display name, sanitized and versioned, as defined by the avatar mixer.
53
+ * It is unique among all avatars present in the domain at the time.
54
+ * @property {boolean} isReplicated - <span class="important">Deprecated: This property is deprecated and will be
55
+ * removed.</span>
56
+ * @property {boolean} lookAtSnappingEnabled - <code>true</code> if the avatar's eyes snap to look at another avatar's eyes
57
+ * when the other avatar is in the line of sight and also has <code>lookAtSnappingEnabled == true</code>.
58
+ *
59
+ * @property {string} skeletonModelURL - The avatar's FST file.
60
+ * @property {AttachmentData[]} attachmentData - Information on the avatar's attachments.
61
+ * <p class="important">Deprecated: This property is deprecated and will be removed. Use avatar entities instead.</p>
62
+ * @property {string[]} jointNames - The list of joints in the avatar model.
63
+ *
64
+ * @property {number} audioLoudness - The instantaneous loudness of the audio input that the avatar is injecting into the
65
+ * domain.
66
+ * @property {number} audioAverageLoudness - The rolling average loudness of the audio input that the avatar is injecting into
67
+ * the domain.
68
+ *
69
+ * @property {Mat4} sensorToWorldMatrix - The scale, rotation, and translation transform from the user's real world to the
70
+ * avatar's size, orientation, and position in the virtual world.
71
+ * @property {Mat4} controllerLeftHandMatrix - The rotation and translation of the left hand controller relative to the avatar.
72
+ * @property {Mat4} controllerRightHandMatrix - The rotation and translation of the right hand controller relative to the
73
+ * avatar.
74
+ *
75
+ * @property {Vec3} skeletonOffset - The rendering offset of the avatar.
76
+ */
19
77
class ScriptAvatar : public ScriptAvatarData {
20
78
Q_OBJECT
21
79
@@ -26,27 +84,138 @@ class ScriptAvatar : public ScriptAvatarData {
26
84
27
85
public slots:
28
86
87
+ /* *jsdoc
88
+ * Gets the default rotation of a joint in the avatar relative to its parent.
89
+ * <p>For information on the joint hierarchy used, see
90
+ * <a href="https://docs.highfidelity.com/create/avatars/avatar-standards.html">Avatar Standards</a>.</p>
91
+ * @function ScriptAvatar.getDefaultJointRotation
92
+ * @param {number} index - The joint index.
93
+ * @returns {Quat} The default rotation of the joint if avatar data are available and the joint index is valid, otherwise
94
+ * {@link Quat(0)|Quat.IDENTITY}.
95
+ */
29
96
glm::quat getDefaultJointRotation (int index) const ;
97
+
98
+ /* *jsdoc
99
+ * Gets the default translation of a joint in the avatar relative to its parent, in model coordinates.
100
+ * <p><strong>Warning:</strong> These coordinates are not necessarily in meters.</p>
101
+ * <p>For information on the joint hierarchy used, see
102
+ * <a href="https://docs.highfidelity.com/create/avatars/avatar-standards.html">Avatar Standards</a>.</p>
103
+ * @function ScriptAvatar.getDefaultJointTranslation
104
+ * @param {number} index - The joint index.
105
+ * @returns {Vec3} The default translation of the joint (in model coordinates) if avatar data are available and the joint
106
+ * index is valid, otherwise {@link Vec3(0)|Vec3.ZERO}.
107
+ */
30
108
glm::vec3 getDefaultJointTranslation (int index) const ;
31
109
110
+
111
+ /* *jsdoc
112
+ * Gets the offset applied to the avatar for rendering.
113
+ * @function ScriptAvatar.getSkeletonOffset
114
+ * @returns {Vec3} The skeleton offset if avatar data are available, otherwise {@link Vec3(0)|Vec3.ZERO}.
115
+ */
32
116
glm::vec3 getSkeletonOffset () const ;
33
117
118
+
119
+ /* *jsdoc
120
+ * Gets the position of a joint in the avatar.
121
+ * @function ScriptAvatar.getJointPosition
122
+ * @param {number} index - The index of the joint.
123
+ * @returns {Vec3} The position of the joint in world coordinates, or {@link Vec3(0)|Vec3.ZERO} if avatar data aren't
124
+ * available.
125
+ */
34
126
glm::vec3 getJointPosition (int index) const ;
127
+
128
+ /* *jsdoc
129
+ * Gets the position of a joint in the current avatar.
130
+ * @function ScriptAvatar.getJointPosition
131
+ * @param {string} name - The name of the joint.
132
+ * @returns {Vec3} The position of the joint in world coordinates, or {@link Vec3(0)|Vec3.ZERO} if avatar data aren't
133
+ * available.
134
+ */
35
135
glm::vec3 getJointPosition (const QString& name) const ;
136
+
137
+ /* *jsdoc
138
+ * Gets the position of the current avatar's neck in world coordinates.
139
+ * @function ScriptAvatar.getNeckPosition
140
+ * @returns {Vec3} The position of the neck in world coordinates, or {@link Vec3(0)|Vec3.ZERO} if avatar data aren't
141
+ * available.
142
+ */
36
143
glm::vec3 getNeckPosition () const ;
37
144
145
+
146
+ /* *jsdoc
147
+ * Gets the current acceleration of the avatar.
148
+ * @function ScriptAvatar.getAcceleration
149
+ * @returns {Vec3} The current acceleration of the avatar, or {@link Vec3(0)|Vec3.ZERO} if avatar data aren't available..
150
+ */
38
151
glm::vec3 getAcceleration () const ;
39
152
153
+
154
+ /* *jsdoc
155
+ * Gets the ID of the entity of avatar that the avatar is parented to.
156
+ * @function ScriptAvatar.getParentID
157
+ * @returns {Uuid} The ID of the entity or avatar that the avatar is parented to. {@link Uuid(0)|Uuid.NULL} if not parented
158
+ * or avatar data aren't available.
159
+ */
40
160
QUuid getParentID () const ;
161
+
162
+ /* *jsdoc
163
+ * Gets the joint of the entity or avatar that the avatar is parented to.
164
+ * @function ScriptAvatar.getParentJointIndex
165
+ * @returns {number} The joint of the entity or avatar that the avatar is parented to. <code>65535</code> or
166
+ * <code>-1</code> if parented to the entity or avatar's position and orientation rather than a joint, or avatar data
167
+ * aren't available.
168
+ */
41
169
quint16 getParentJointIndex () const ;
42
170
171
+
172
+ /* *jsdoc
173
+ * Gets information on all the joints in the avatar's skeleton.
174
+ * @function ScriptAvatar.getSkeleton
175
+ * @returns {SkeletonJoint[]} Information about each joint in the avatar's skeleton.
176
+ */
43
177
QVariantList getSkeleton () const ;
44
178
179
+
180
+ /* *jsdoc
181
+ * @function ScriptAvatar.getSimulationRate
182
+ * @param {AvatarSimulationRate} [rateName=""] - Rate name.
183
+ * @returns {number} Simulation rate in Hz, or <code>0.0</code> if avatar data aren't available.
184
+ * @deprecated This function is deprecated and will be removed.
185
+ */
45
186
float getSimulationRate (const QString& rateName = QString(" " )) const ;
46
187
188
+
189
+ /* *jsdoc
190
+ * Gets the position of the left palm in world coordinates.
191
+ * @function ScriptAvatar.getLeftPalmPosition
192
+ * @returns {Vec3} The position of the left palm in world coordinates, or {@link Vec3(0)|Vec3.ZERO} if avatar data aren't
193
+ * available.
194
+ */
47
195
glm::vec3 getLeftPalmPosition () const ;
196
+
197
+ /* *jsdoc
198
+ * Gets the rotation of the left palm in world coordinates.
199
+ * @function ScriptAvatar.getLeftPalmRotation
200
+ * @returns {Quat} The rotation of the left palm in world coordinates, or {@link Quat(0)|Quat.IDENTITY} if the avatar data
201
+ * aren't available.
202
+ */
48
203
glm::quat getLeftPalmRotation () const ;
204
+
205
+ /* *jsdoc
206
+ * Gets the position of the right palm in world coordinates.
207
+ * @function ScriptAvatar.getLeftPalmPosition
208
+ * @returns {Vec3} The position of the right palm in world coordinates, or {@link Vec3(0)|Vec3.ZERO} if avatar data aren't
209
+ * available.
210
+ */
49
211
glm::vec3 getRightPalmPosition () const ;
212
+
213
+ /* *jsdoc
214
+ * Gets the rotation of the right palm in world coordinates.
215
+ * @function ScriptAvatar.getLeftPalmRotation
216
+ * @returns {Quat} The rotation of the right palm in world coordinates, or {@link Quat(0)|Quat.IDENTITY} if the avatar data
217
+ * aren't available.
218
+ */
50
219
glm::quat getRightPalmRotation () const ;
51
220
52
221
private:
0 commit comments