Description
Supported Script Types: Assignment Client Scripts
TheAvatar
API is used to manipulate scriptable avatars on the domain. This API is a subset of the
MyAvatar API. To enable this API, set Agent.isAvatar to true
.
For Interface, client entity, and avatar scripts, see MyAvatar.
Example
(function () {
Agent.setIsAvatar(true);
print("Position: " + JSON.stringify(Avatar.position)); // 0, 0, 0
}());
Properties
Name | Type | Summary |
---|---|---|
position | Vec3 |
The position of the avatar. |
scale | number |
The scale of the avatar. The value can be set to anything between Default Value: 1.0 |
density | number |
The density of the avatar in kg/m3. The density is used to work out its mass in the application of physics. Read-only. |
handPosition | Vec3 |
A user-defined hand position, in world coordinates. The position moves with the avatar but is otherwise not used or changed by Interface. |
bodyYaw | number |
The left or right rotation about an axis running from the head to the feet of the avatar. Yaw is sometimes called "heading". |
bodyPitch | number |
The rotation about an axis running from shoulder to shoulder of the avatar. Pitch is sometimes called "elevation". |
bodyRoll | number |
The rotation about an axis running from the chest to the back of the avatar. Roll is sometimes called "bank". |
orientation | Quat |
The orientation of the avatar. |
headOrientation | Quat |
The orientation of the avatar's head. |
headPitch | number |
The rotation about an axis running from ear to ear of the avatar's head. Pitch is sometimes called "elevation". |
headYaw | number |
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". |
headRoll | number |
The rotation about an axis running from the nose to the back of the avatar's head. Roll is sometimes called "bank". |
velocity | Vec3 |
The current velocity of the avatar. |
angularVelocity | Vec3 |
The current angular velocity of the avatar. |
audioLoudness | number |
The instantaneous loudness of the audio input that the avatar is injecting into the domain. |
audioAverageLoudness | number |
The rolling average loudness of the audio input that the avatar is injecting into the domain. |
displayName | string |
The avatar's display name. |
sessionDisplayName | string |
|
lookAtSnappingEnabled | boolean |
Default Value: true |
skeletonModelURL | string |
The avatar's FST file. |
attachmentData | Array.<AttachmentData> |
Information on the avatar's attachments. Deprecated: This property is deprecated and will be removed. Use avatar entities instead. |
jointNames | Array.<string> |
The list of joints in the current avatar model. Read-only. |
sessionUUID | Uuid |
Unique ID of the avatar in the domain. Read-only. |
sensorToWorldMatrix | 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. Read-only. |
controllerLeftHandMatrix | Mat4 |
The rotation and translation of the left hand controller relative to the avatar. Read-only. |
controllerRightHandMatrix | Mat4 |
The rotation and translation of the right hand controller relative to the avatar. Read-only. |
sensorToWorldScale | number |
The scale that transforms dimensions in the user's real world to the avatar's size in the virtual world. Read-only. |
hasPriority | boolean |
|
hasScriptedBlendshapes | boolean |
Note: This property will automatically be set to true if the Controller system has valid facial blend shape actions. Default Value: false |
hasProceduralBlinkFaceMovement | boolean |
Default Value: true |
hasProceduralEyeFaceMovement | boolean |
Default Value: true |
hasAudioEnabledFaceMovement | boolean |
Default Value: true |
Methods
Name | Return Value | Summary |
---|---|---|
attach
|
None |
Attaches a model to your avatar. For example, you can give your avatar a hat to wear, a guitar to hold, or a surfboard to stand on. Deprecated: This function is deprecated and will be removed. Use avatar entities instead. |
clearAvatarEntity
|
None |
Deprecated: This function is deprecated and will be removed. |
clearJointData
|
None |
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. |
clearJointData
|
None |
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. |
clearJointsData
|
None |
Clears all joint translations and rotations that have been set by script. This restores all motion from the default animation system including inverse kinematics for all joints. |
detachAll
|
None |
Detaches all instances of a particular model from either a specific joint or all joints. Deprecated: This function is deprecated and will be removed. Use avatar entities instead. |
detachOne
|
None |
Detaches the most recently attached instance of a particular model from either a specific joint or any joint. Deprecated: This function is deprecated and will be removed. Use avatar entities instead. |
getAbsoluteJointRotationInObjectFrame
|
Quat |
Gets the rotation of a joint relative to the avatar. Warning: Not able to be used in the |
getAbsoluteJointTranslationInObjectFrame
|
Vec3 |
Gets the translation of a joint relative to the avatar. Warning: Not able to be used in the |
getAnimationDetails
|
Avatar.AnimationDetails |
Gets the details of the current avatar animation that is being or was recently played. |
getAttachmentData
|
Array.<AttachmentData> |
Gets information about the models currently attached to your avatar. Deprecated: This function is deprecated and will be removed. Use avatar entities instead. |
getAttachmentsVariant
|
Array.<AttachmentData> |
Gets information about the models currently attached to your avatar. Deprecated: This function is deprecated and will be removed. Use avatar entities instead. |
getAvatarEntityData
|
AvatarEntityMap |
Gets details of all avatar entities. Warning: Potentially an expensive call. Do not use if possible. |
getControllerLeftHandMatrix
|
Mat4 |
Gets the rotation and translation of the left hand controller relative to the avatar. |
getControllerRightHandMatrix
|
Mat4 |
Gets the rotation and translation of the right hand controller relative to the avatar. |
getDataRate
|
number |
Gets the amount of avatar mixer data being generated by the avatar. |
getDomainMaxScale
|
number |
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. |
getDomainMinScale
|
number |
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. |
getEyeHeight
|
number |
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. |
getHandState
|
HandState |
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. |
getHeight
|
number |
Gets the current height of the avatar. This height is only an estimate and might be incorrect for avatars that are missing standard joints. |
getJointIndex
|
number |
Gets the joint index for a named joint. The joint index value is the position of the joint in the array returned by
MyAvatar.getJointNames, or Avatar.getJointNames if using the |
getJointNames
|
Array.<string> |
Gets the names of all the joints in the current avatar. |
getJointRotation
|
Quat |
Gets the rotation of a joint relative to its parent. For information on the joint hierarchy used, see Avatar Standards. |
getJointRotation
|
Quat |
Gets the rotation of a joint relative to its parent. For information on the joint hierarchy used, see Avatar Standards. |
getJointRotations
|
Array.<Quat> |
Gets the rotations of all joints in the current avatar. Each joint's rotation is relative to its parent joint. |
getJointTranslation
|
Vec3 |
Gets the translation of a joint relative to its parent, in model coordinates. Warning: These coordinates are not necessarily in meters. For information on the joint hierarchy used, see Avatar Standards. |
getJointTranslation
|
Vec3 |
Gets the translation of a joint relative to its parent, in model coordinates. Warning: These coordinates are not necessarily in meters. For information on the joint hierarchy used, see Avatar Standards. |
getJointTranslations
|
Array.<Vec3> |
Gets the translations of all joints in the current avatar. Each joint's translation is relative to its parent joint, in model coordinates. Warning: These coordinates are not necessarily in meters. |
getSensorToWorldMatrix
|
Mat4 |
Gets the transform from the user's real world to the avatar's size, orientation, and position in the virtual world. |
getSensorToWorldScale
|
number |
Gets the scale that transforms dimensions in the user's real world to the avatar's size in the virtual world. |
getTargetScale
|
number |
Gets the target scale of the avatar without any restrictions on permissible values imposed by the domain. In contrast, the
|
getUpdateRate
|
number |
Gets the update rate of avatar mixer data being generated by the avatar. |
isJointDataValid
|
boolean |
Checks that the data for a joint are valid. |
isJointDataValid
|
boolean |
Checks if the data for a joint are valid. |
resetLastSent
|
None |
Deprecated: This function is deprecated and will be removed. |
sendAvatarDataPacket
|
number |
Deprecated: This function is deprecated and will be removed. |
sendIdentityPacket
|
number |
Deprecated: This function is deprecated and will be removed. |
setAbsoluteJointRotationInObjectFrame
|
boolean |
Sets the rotation of a joint relative to the avatar. Warning: Not able to be used in the |
setAbsoluteJointTranslationInObjectFrame
|
boolean |
Sets the translation of a joint relative to the avatar. Warning: Not able to be used in the |
setAttachmentData
|
None |
Sets all models currently attached to your avatar. For example, if you retrieve attachment data using
MyAvatar.getAttachmentData or Avatar.getAttachmentData, make changes to it, and then want to update your avatar's attachments per the
changed data. You can also remove all attachments by using setting Deprecated: This function is deprecated and will be removed. Use avatar entities instead. |
setAttachmentsVariant
|
None |
Sets all models currently attached to your avatar. For example, if you retrieve attachment data using MyAvatar.getAttachmentsVariant or Avatar.getAttachmentsVariant, make changes to it, and then want to update your avatar's attachments per the changed data. Deprecated: This function is deprecated and will be removed. Use avatar entities instead. |
setAvatarEntityData
|
None |
Sets all avatar entities from an object. Warning: Potentially an expensive call. Do not use if possible. |
setBlendshape
|
None |
Sets the value of a blend shape to animate your avatar's face. In order for other users to see the resulting animations
on your avatar's face, set |
setForceFaceTrackerConnected
|
None |
Enables blend shapes set using Avatar.setBlendshape or MyAvatar.setBlendshape to be transmitted to other users so that they can see the animation of your avatar's face. Deprecated: This method is deprecated and will be removed. Use the
|
setHandState
|
None |
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. |
setJointData
|
None |
Sets a specific joint's rotation and position relative to its parent, in model coordinates. Warning: These coordinates are not necessarily in meters. 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. |
setJointData
|
None |
Sets a specific joint's rotation and position relative to its parent, in model coordinates. Warning: These coordinates are not necessarily in meters. 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. |
setJointMappingsFromNetworkReply
|
None |
Deprecated: This function is deprecated and will be removed. |
setJointRotation
|
None |
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 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. |
setJointRotation
|
None |
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 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. |
setJointRotations
|
None |
Sets the rotations of all joints in the current avatar. Each joint's rotation is relative to its parent joint. 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. |
setJointTranslation
|
None |
Sets a specific joint's translation relative to its parent, in model coordinates. Warning: These coordinates are not necessarily in meters. 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. |
setJointTranslation
|
None |
Sets a specific joint's translation relative to its parent, in model coordinates. Warning: These coordinates are not necessarily in meters. 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. |
setJointTranslations
|
None |
Sets the translations of all joints in the current avatar. Each joint's translation is relative to its parent joint, in model coordinates. Warning: These coordinates are not necessarily in meters. 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. |
setSessionUUID
|
None |
Deprecated: This function is deprecated and will be removed. |
setSkeletonModelURL
|
None |
Sets the avatar's skeleton model. |
startAnimation
|
None |
Starts playing an animation on the avatar. |
stopAnimation
|
None |
Stops playing the current animation. |
update
|
None |
Deprecated: This function is deprecated and will be removed. |
updateAvatarEntity
|
None |
Deprecated: This function is deprecated and will be removed. |
Signals
Name | Summary |
---|---|
displayNameChanged
|
Triggered when the avatar's |
lookAtSnappingChanged
|
Triggered when the avatar's |
sessionDisplayNameChanged
|
Triggered when the avatar's |
sessionUUIDChanged
|
Triggered when the avatar's |
skeletonModelURLChanged
|
Triggered when the avatar's model (i.e., |
Type Definitions
AnimationDetails Type: object |
|||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The details of an animation that is playing. Properties
|
Method Details
(static) attach( modelURL, jointNameopt, translationopt, rotationopt, scaleopt, isSoftopt, allowDuplicatesopt, useSavedopt ) | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Attaches a model to your avatar. For example, you can give your avatar a hat to wear, a guitar to hold, or a surfboard to stand on. Deprecated: This function is deprecated and will be removed. Use avatar entities instead. Parameters
Example
|
(static) clearAvatarEntity( entityID, requiresRemovalFromTreeopt ) | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) clearJointData( index ) | ||||||
---|---|---|---|---|---|---|
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. Parameters
|
(static) clearJointData( name ) | ||||||
---|---|---|---|---|---|---|
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. Parameters
Example
|
(static) clearJointsData( ) |
---|
Clears all joint translations and rotations that have been set by script. This restores all motion from the default animation system including inverse kinematics for all joints. Example
|
(static) detachAll( modelURL, jointNameopt ) | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Detaches all instances of a particular model from either a specific joint or all joints. Deprecated: This function is deprecated and will be removed. Use avatar entities instead. Parameters
|
(static) detachOne( modelURL, jointNameopt ) | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Detaches the most recently attached instance of a particular model from either a specific joint or any joint. Deprecated: This function is deprecated and will be removed. Use avatar entities instead. Parameters
|
(static) getAbsoluteJointRotationInObjectFrame( index ) → {Quat}
Returns: Quat.IDENTITY .
|
||||||
---|---|---|---|---|---|---|
Gets the rotation of a joint relative to the avatar. Warning: Not able to be used in the Parameters
|
(static) getAbsoluteJointTranslationInObjectFrame( index ) → {Vec3}
Returns: Vec3.ZERO .
|
||||||
---|---|---|---|---|---|---|
Gets the translation of a joint relative to the avatar. Warning: Not able to be used in the Parameters
|
(static) getAnimationDetails( ) → {Avatar.AnimationDetails}
Returns: The current or recent avatar animation. |
---|
Gets the details of the current avatar animation that is being or was recently played. Example
|
(static) getAttachmentData( ) → {Array.<AttachmentData>}
Returns: Information about all models attached to your avatar. |
---|
Gets information about the models currently attached to your avatar. Deprecated: This function is deprecated and will be removed. Use avatar entities instead. Example
|
(static) getAttachmentsVariant( ) → {Array.<AttachmentData>}
Returns: Information about all models attached to your avatar. |
---|
Gets information about the models currently attached to your avatar. Deprecated: This function is deprecated and will be removed. Use avatar entities instead. |
(static) getAvatarEntityData( ) → {AvatarEntityMap}
Returns: Details of all avatar entities. |
---|
Gets details of all avatar entities. Warning: Potentially an expensive call. Do not use if possible. Example
|
(static) getControllerLeftHandMatrix( ) → {Mat4}
Returns: The rotation and translation of the left hand controller relative to the avatar. |
---|
Gets the rotation and translation of the left hand controller relative to the avatar. Example
|
(static) getControllerRightHandMatrix( ) → {Mat4}
Returns: The rotation and translation of the right hand controller relative to the avatar. |
---|
Gets the rotation and translation of the right hand controller relative to the avatar. |
(static) getDataRate( rateNameopt ) → {number}
Returns: The data rate in kbps. |
||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Gets the amount of avatar mixer data being generated by the avatar. Parameters
|
(static) getDomainMaxScale( ) → {number}
Returns: 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. |
(static) getDomainMinScale( ) → {number}
Returns: 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. |
(static) getEyeHeight( ) → {number}
Returns: The 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. |
(static) getHandState( ) → {HandState}
Returns: The pointing state of the hand. |
---|
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. |
(static) getHeight( ) → {number}
Returns: The 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. |
(static) getJointIndex( name ) → {number}
Returns: The index of the joint if valid, otherwise -1 .
|
||||||
---|---|---|---|---|---|---|
Gets the joint index for a named joint. The joint index value is the position of the joint in the array returned by
MyAvatar.getJointNames, or Avatar.getJointNames if using the Parameters
Example
|
(static) getJointNames( ) → {Array.<string>}
Returns: The joint names. |
---|
Gets the names of all the joints in the current avatar. Example
|
(static) getJointRotation( index ) → {Quat}
Returns: The rotation of the joint relative to its parent. |
||||||
---|---|---|---|---|---|---|
Gets the rotation of a joint relative to its parent. For information on the joint hierarchy used, see Avatar Standards. Parameters
|
(static) getJointRotation( name ) → {Quat}
Returns: The rotation of the joint relative to its parent. |
||||||
---|---|---|---|---|---|---|
Gets the rotation of a joint relative to its parent. For information on the joint hierarchy used, see Avatar Standards. Parameters
Example
|
(static) getJointRotations( ) → {Array.<Quat>}
Returns: The rotations of all joints relative to each's parent. The values are in the same order as the array returned by MyAvatar.getJointNames, or Avatar.getJointNames if using the Avatar API.
|
---|
Gets the rotations of all joints in the current avatar. Each joint's rotation is relative to its parent joint. Example
|
(static) getJointTranslation( index ) → {Vec3}
Returns: The translation of the joint relative to its parent, in model coordinates. |
||||||
---|---|---|---|---|---|---|
Gets the translation of a joint relative to its parent, in model coordinates. Warning: These coordinates are not necessarily in meters. For information on the joint hierarchy used, see Avatar Standards. Parameters
|
(static) getJointTranslation( name ) → {Vec3}
Returns: The translation of the joint relative to its parent, in model coordinates. |
||||||
---|---|---|---|---|---|---|
Gets the translation of a joint relative to its parent, in model coordinates. Warning: These coordinates are not necessarily in meters. For information on the joint hierarchy used, see Avatar Standards. Parameters
Example
|
(static) getJointTranslations( ) → {Array.<Vec3>}
Returns: The translations of all joints relative to each's parent, in model coordinates. The values are in the same order as the array returned by MyAvatar.getJointNames, or Avatar.getJointNames if using the Avatar API.
|
---|
Gets the translations of all joints in the current avatar. Each joint's translation is relative to its parent joint, in model coordinates. Warning: These coordinates are not necessarily in meters. |
(static) getSensorToWorldMatrix( ) → {Mat4}
Returns: The scale, rotation, and translation transform from the user's real world to the avatar's size, orientation, and position in the virtual world. |
---|
Gets the transform from the user's real world to the avatar's size, orientation, and position in the virtual world. Example
|
(static) getSensorToWorldScale( ) → {number}
Returns: The scale that transforms dimensions in the user's real world to the avatar's size in the virtual world. |
---|
Gets the scale that transforms dimensions in the user's real world to the avatar's size in the virtual world. |
(static) getTargetScale( ) → {number}
Returns: The target scale of the avatar. |
---|
Gets the target scale of the avatar without any restrictions on permissible values imposed by the domain. In contrast, the
Example
|
(static) getUpdateRate( rateNameopt ) → {number}
Returns: The update rate in Hz. |
||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Gets the update rate of avatar mixer data being generated by the avatar. Parameters
|
(static) isJointDataValid( index ) → {boolean}
Returns: true if the joint data are valid, false if not.
|
||||||
---|---|---|---|---|---|---|
Checks that the data for a joint are valid. Parameters
|
(static) isJointDataValid( name ) → {boolean}
Returns: true if the joint data are valid, false if not.
|
||||||
---|---|---|---|---|---|---|
Checks if the data for a joint are valid. Parameters
|
(static) resetLastSent( ) |
---|
Deprecated: This function is deprecated and will be removed. |
(static) sendAvatarDataPacket( sendAllopt ) → {number}
Returns: number |
||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) sendIdentityPacket( ) → {number}
Returns: number |
---|
Deprecated: This function is deprecated and will be removed. |
(static) setAbsoluteJointRotationInObjectFrame( index, rotation ) → {boolean}
Returns: false .
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Sets the rotation of a joint relative to the avatar. Warning: Not able to be used in the Parameters
|
(static) setAbsoluteJointTranslationInObjectFrame( index, translation ) → {boolean}
Returns: false .
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Sets the translation of a joint relative to the avatar. Warning: Not able to be used in the Parameters
|
(static) setAttachmentData( attachmentData ) | ||||||
---|---|---|---|---|---|---|
Sets all models currently attached to your avatar. For example, if you retrieve attachment data using
MyAvatar.getAttachmentData or Avatar.getAttachmentData, make changes to it, and then want to update your avatar's attachments per the
changed data. You can also remove all attachments by using setting Deprecated: This function is deprecated and will be removed. Use avatar entities instead. Parameters
Example
|
(static) setAttachmentsVariant( variant ) | ||||||
---|---|---|---|---|---|---|
Sets all models currently attached to your avatar. For example, if you retrieve attachment data using MyAvatar.getAttachmentsVariant or Avatar.getAttachmentsVariant, make changes to it, and then want to update your avatar's attachments per the changed data. Deprecated: This function is deprecated and will be removed. Use avatar entities instead. Parameters
|
(static) setAvatarEntityData( avatarEntityData ) | ||||||
---|---|---|---|---|---|---|
Sets all avatar entities from an object. Warning: Potentially an expensive call. Do not use if possible. Parameters
|
(static) setBlendshape( name, value ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets the value of a blend shape to animate your avatar's face. In order for other users to see the resulting animations
on your avatar's face, set Parameters
Example
|
(static) setForceFaceTrackerConnected( connected ) | ||||||
---|---|---|---|---|---|---|
Enables blend shapes set using Avatar.setBlendshape or MyAvatar.setBlendshape to be transmitted to other users so that they can see the animation of your avatar's face. Deprecated: This method is deprecated and will be removed. Use the
Parameters
|
(static) setHandState( state ) | ||||||
---|---|---|---|---|---|---|
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. Parameters
|
(static) setJointData( index, rotation, translation ) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets a specific joint's rotation and position relative to its parent, in model coordinates. Warning: These coordinates are not necessarily in meters. 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. Parameters
Example
|
(static) setJointData( name, rotation, translation ) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets a specific joint's rotation and position relative to its parent, in model coordinates. Warning: These coordinates are not necessarily in meters. 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. Parameters
|
(static) setJointMappingsFromNetworkReply( ) |
---|
Deprecated: This function is deprecated and will be removed. |
(static) setJointRotation( index, rotation ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
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 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. Parameters
|
(static) setJointRotation( name, rotation ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
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 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. Parameters
Example
|
(static) setJointRotations( jointRotations ) | ||||||
---|---|---|---|---|---|---|
Sets the rotations of all joints in the current avatar. Each joint's rotation is relative to its parent joint. 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. Parameters
Example
|
(static) setJointTranslation( index, translation ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets a specific joint's translation relative to its parent, in model coordinates. Warning: These coordinates are not necessarily in meters. 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. Parameters
|
(static) setJointTranslation( name, translation ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets a specific joint's translation relative to its parent, in model coordinates. Warning: These coordinates are not necessarily in meters. 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. Parameters
Example
|
(static) setJointTranslations( translations ) | ||||||
---|---|---|---|---|---|---|
Sets the translations of all joints in the current avatar. Each joint's translation is relative to its parent joint, in model coordinates. Warning: These coordinates are not necessarily in meters. 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. Parameters
|
(static) setSessionUUID( sessionUUID ) | ||||||
---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) setSkeletonModelURL( url ) | ||||||
---|---|---|---|---|---|---|
Sets the avatar's skeleton model. Parameters
|
(static) startAnimation( url, fpsopt, priorityopt, loopopt, holdopt, firstFrameopt, lastFrameopt, maskedJointsopt ) | |||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Starts playing an animation on the avatar. Parameters
|
(static) stopAnimation( ) |
---|
Stops playing the current animation. |
(static) update( deltaTime ) | ||||||
---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) updateAvatarEntity( entityID, entityData ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
Signal Details
displayNameChanged(
)
Returns: Signal |
---|
Triggered when the avatar's Example
|
lookAtSnappingChanged(
enabled
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when the avatar's Parameters
Example
|
sessionDisplayNameChanged(
)
Returns: Signal |
---|
Triggered when the avatar's Example
|
sessionUUIDChanged(
)
Returns: Signal |
---|
Triggered when the avatar's Example
|
skeletonModelURLChanged(
)
Returns: Signal |
---|
Triggered when the avatar's model (i.e., Example
|