Description
Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts
Your avatar is your in-world representation of you. TheMyAvatar
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 the environment and other avatars.
For assignment client scripts, see Avatar.
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. |
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 Default Value: false |
hasProceduralBlinkFaceMovement | boolean |
Default Value: true |
hasProceduralEyeFaceMovement | boolean |
Default Value: true |
hasAudioEnabledFaceMovement | boolean |
Default Value: true |
skeletonOffset | Vec3 |
Can be used to apply a translation offset between the avatar's position and the registration point of the 3D model. |
qmlPosition | Vec3 |
A synonym for Deprecated: This property is deprecated and will be removed. |
feetPosition | Vec3 |
The position of the avatar's feet. |
shouldRenderLocally | boolean |
If Default Value: true |
motorVelocity | Vec3 |
The target velocity of your avatar to be achieved by a scripted motor. Default Value: Vec3.ZERO |
motorTimescale | number |
The timescale for the scripted motor to achieve the target
Default Value: 1000000 |
motorReferenceFrame | string |
Reference frame of the Default Value: "camera" |
motorMode | string |
The Type of scripted motor behavior: Default Value: "simple" |
collisionSoundURL | string |
The sound that's played when the avatar experiences a collision. It can be a mono or stereo 16-bit WAV file running at either 24kHz or 48kHz. The latter is down-sampled by the audio mixer, so all audio effectively plays back at a 24khz. 48kHz RAW files are also supported. Default Value: "Body_Hits_Impact.wav" |
audioListenerMode | number |
Specifies the listening position when hearing spatialized audio. Must be one of the following property values:
Default Value: 0 |
audioListenerModeHead | number |
The audio listening position is at the avatar's head. Read-only. Default Value: 0 |
audioListenerModeCamera | number |
The audio listening position is at the camera. Read-only. Default Value: 1 |
audioListenerModeCustom | number |
The audio listening position is at a the position specified by set by the
Default Value: 2 |
customListenPosition | Vec3 |
The listening position used when the Default Value: Vec3.ZERO |
customListenOrientation | Quat |
The listening orientation used when the
Default Value: Quat.IDENTITY |
rotationRecenterFilterLength | number |
Configures how quickly the avatar root rotates to recenter its facing
direction to match that of the user's torso based on head and hands orientation. A smaller value makes the
recentering happen more quickly. The minimum value is |
rotationThreshold | number |
The angle in radians that the user's torso facing direction (based on head and hands orientation) can differ from that of the avatar before the avatar's root is rotated to match the user's torso. |
enableStepResetRotation | boolean |
If |
enableDrawAverageFacing | boolean |
If |
leftHandPosition | Vec3 |
The position of the left hand in avatar coordinates if it's being positioned by controllers, otherwise Vec3.ZERO. Read-only. |
rightHandPosition | Vec3 |
The position of the right hand in avatar coordinates if it's being positioned by controllers, otherwise Vec3.ZERO. Read-only. |
leftHandTipPosition | Vec3 |
The position 0.3m in front of the left hand's position, in the direction along the palm, in avatar coordinates. If the hand isn't being positioned by a controller, the value is Vec3.ZERO. Read-only. |
rightHandTipPosition | Vec3 |
The position 0.3m in front of the right hand's position, in the direction along the palm, in avatar coordinates. If the hand isn't being positioned by a controller, the value is Vec3.ZERO. Read-only. |
leftHandPose | Pose |
The left hand's pose as determined by the hand controllers, relative to the avatar. Read-only. |
rightHandPose | Pose |
The right hand's pose as determined by the hand controllers, relative to the avatar. Read-only. |
leftHandTipPose | Pose |
The left hand's pose as determined by the hand controllers, relative to the avatar, with the position adjusted by 0.3m along the direction of the palm. Read-only. |
rightHandTipPose | Pose |
The right hand's pose as determined by the hand controllers, relative to the avatar, with the position adjusted by 0.3m along the direction of the palm. Read-only. |
energy | number |
Deprecated: This property will be removed. |
isAway | boolean |
|
centerOfGravityModelEnabled | boolean |
Default Value: true |
hmdLeanRecenterEnabled | boolean |
Default Value: true |
collisionsEnabled | boolean |
Set to |
otherAvatarsCollisionsEnabled | boolean |
Set to |
characterControllerEnabled | boolean |
Synonym of Deprecated: This property is deprecated and will be removed. Use |
useAdvancedMovementControls | boolean |
Returns and sets the value of the Interface setting, Settings > Controls > Walking. Note: Setting the value has no effect unless Interface is restarted. |
showPlayArea | boolean |
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. |
yawSpeed | number |
The mouse X sensitivity value in Settings > General. Read-only. Default Value: 75 |
pitchSpeed | number |
The mouse Y sensitivity value in Settings > General. Read-only. Default Value: 50 |
hmdRollControlEnabled | boolean |
If Default Value: true |
hmdRollControlDeadZone | number |
The amount of HMD roll, in degrees, required before your avatar turns if
Default Value: 8 |
hmdRollControlRate | number |
If |
userHeight | number |
The height of the user in sensor space. Default Value: 1.75 |
userEyeHeight | number |
The estimated height of the user's eyes in sensor space. Read-only. Default Value: 1.65 |
SELF_ID | Uuid |
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. |
walkSpeed | number |
The walk speed of your avatar for the current control scheme (see getControlScheme). |
walkBackwardSpeed | number |
The walk backward speed of your avatar for the current control scheme (see getControlScheme). |
sprintSpeed | number |
The sprint (run) speed of your avatar for the current control scheme (see getControlScheme). |
analogPlusWalkSpeed | number |
The walk speed of your avatar for the "AnalogPlus" control scheme. Warning: Setting this value also sets the value of |
analogPlusSprintSpeed | number |
The sprint (run) speed of your avatar for the "AnalogPlus" control scheme. |
userRecenterModel | MyAvatar.SitStandModelType |
Controls avatar leaning and recentering behavior. Deprecated: This property is deprecated and will be removed. |
isInSittingState | boolean |
|
isSitStandStateLocked | boolean |
Deprecated: This property is deprecated and will be removed.
See also: |
allowTeleporting | boolean |
|
Methods
Name | Return Value | Summary |
---|---|---|
addAnimationStateHandler
|
number |
Adds an animation state handler function that is invoked just before each animation graph update. More than one
animation state handler function may be added by calling The animation state handler function is called with an AnimStateDictionary
" A handler may change a value from |
addThrust
|
None |
Adds a thrust to your avatar's current thrust to be applied for a short while. Deprecated: This function is deprecated and will be removed. Use MyAvatar.motorVelocity and related properties instead. |
animGraphLoaded
|
None |
Deprecated: This function is deprecated and will be removed. |
beginReaction
|
boolean |
Starts playing a reaction on the avatar. The reaction will continue to play until stopped using MyAvatar.endReaction or superseded by another reaction. Only reactions returned by MyAvatar.getBeginEndReactions are available. |
beginSit
|
None |
Starts a sitting action for the avatar. |
centerBody
|
None |
Moves and orients the avatar, such that it is directly underneath the HMD, with toes pointed forward in the direction of the HMD. |
clearAvatarEntity
|
None |
Deprecated: This function is deprecated and will be removed. |
clearIKJointLimitHistory
|
None |
Clears inverse kinematics joint limit history. 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, e.g., after finishing with an override animation. |
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. |
clearPinOnJoint
|
boolean |
Clears a lock on a joint's position and orientation, as set by pinJoint. Note: Only works on the hips joint. |
clearScaleRestriction
|
None |
Deprecated: This function is deprecated and will be removed. |
decreaseSize
|
None |
Decreases the avatar's scale by five percent, down to a minimum scale of |
disableDriveKey
|
None |
Disables the action associated with a drive key. |
disableHandTouchForID
|
None |
Disables the hand touch effect on a specific entity. 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. |
enableDriveKey
|
None |
Enables the action associated with a drive key. The action may have been disabled with disableDriveKey. |
enableHandTouchForID
|
None |
Enables the hand touch effect on a specific entity. 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. |
endReaction
|
boolean |
Stops playing a reaction that was started using MyAvatar.beginReaction. |
endSit
|
None |
Ends a sitting action for the avatar. |
getAbsoluteDefaultJointRotationInObjectFrame
|
Quat |
Gets 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. |
getAbsoluteDefaultJointTranslationInObjectFrame
|
Vec3 |
Gets 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. |
getAbsoluteJointRotationInObjectFrame
|
Quat |
Gets the rotation of a joint relative to the avatar. |
getAbsoluteJointTranslationInObjectFrame
|
Vec3 |
Gets the translation of a joint relative to the avatar. |
getAcceleration
|
Vec3 |
Gets the current acceleration of the avatar. |
getAnimGraphOverrideUrl
|
string |
Gets the URL of the override animation graph. See Custom Avatar Animations for information on animation graphs. |
getAnimGraphUrl
|
string |
Gets the URL of animation graph (i.e., the avatar animation JSON) that's currently being used for avatar animations. See Custom Avatar Animations for information on animation graphs. |
getAnimationRoles
|
Array.<string> |
Gets the current animation roles. 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 |
getAvatarEntitiesVariant
|
Array.<MyAvatar.AvatarEntityData> |
Gets the current avatar entity IDs and their properties. |
getAvatarEntityData
|
AvatarEntityMap |
Gets details of all avatar entities. Warning: Potentially an expensive call. Do not use if possible. |
getAvatarScale
|
number |
Gets the target scale of the avatar. The target scale is the desired scale of the avatar without any restrictions on permissible scale values imposed by the domain. |
getBeginEndReactions
|
Array.<string> |
Gets the list of reactions names that can be enabled using MyAvatar.beginReaction and MyAvatar.endReaction. See also: MyAvatar.getTriggerReactions. |
getCenterOfGravityModelEnabled
|
boolean |
Gets whether the avatar hips are being balanced over the feet or placed under the head. |
getCharacterControllerEnabled
|
boolean |
Deprecated: This function is deprecated and will be removed. Use MyAvatar.getCollisionsEnabled instead. |
getCollidingFlowJoints
|
Array.<number> |
Gets the indexes of currently colliding flow joints. |
getCollisionCapsule
|
MyAvatar.CollisionCapsule |
Gets the avatar's collision capsule: a cylinder with hemispherical ends that approximates the extents or the avatar. Warning: The values returned are in world coordinates but aren't necessarily up to date with the avatar's current position. |
getCollisionsEnabled
|
boolean |
Gets whether the avatar will currently collide with entities. Note: The avatar will always collide with entities if in a zone that disallows collisionless avatars. |
getControlScheme
|
MyAvatar.LocomotionControlsMode |
Gets the control scheme that is in use. |
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. |
getDefaultEyePosition
|
Vec3 |
Gets the position in world coordinates of the point directly between your avatar's eyes assuming your avatar was in its default pose. This is a reference position; it does not change as your avatar's head moves relative to the avatar position. |
getDefaultJointRotation
|
Quat |
Gets the default rotation of a joint (in the current avatar) relative to its parent. For information on the joint hierarchy used, see Avatar Standards. |
getDefaultJointTranslation
|
Vec3 |
Gets the default translation of a joint (in the current avatar) 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. |
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. |
getDominantHand
|
string |
Gets the avatar's dominant hand. |
getDriveGear1
|
number |
Get the first 'shifting point' for acceleration step function. |
getDriveGear2
|
number |
Get the second 'shifting point' for acceleration step function. |
getDriveGear3
|
number |
Get the third 'shifting point' for acceleration step function. |
getDriveGear4
|
number |
Get the fourth 'shifting point' for acceleration step function. |
getDriveGear5
|
number |
Get the fifth 'shifting point' for acceleration step function. |
getEnableMeshVisible
|
boolean |
Gets whether your avatar mesh is visible. |
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. |
getEyePosition
|
Vec3 |
Gets the current position of the point directly between the avatar's eyes. |
getEyesLookAt
|
Vec3 |
Gets the current target point of the eyes look direction in world coordinates. |
getFlowData
|
MyAvatar.FlowData |
Gets the current flow configuration. |
getFlyingDesktopPref
|
boolean |
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. |
getFlyingEnabled
|
boolean |
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. |
getFlyingHMDPref
|
boolean |
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. |
getFullAvatarModelName
|
string |
Gets the full avatar model name for the current avatar. |
getFullAvatarURLFromPreferences
|
string |
Gets the complete URL for the current avatar. |
getGravity
|
number |
Sets the amount of gravity applied to the avatar in the y-axis direction. (Negative values are downward.) The default
value is |
getHMDLeanRecenterEnabled
|
boolean |
Gets whether the avatar's position updates to recenter the avatar under the head. In room-scale VR, recentering causes your avatar to follow your HMD as you walk around the room. |
getHandRelativeMovement
|
number |
Get your preference for hand-relative movement. |
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. |
getHeadDeltaPitch
|
number |
If a face tracker is connected and being used, gets the estimated pitch of the user's head scaled. This is scale such that the avatar looks at the edge of the view frustum when the user looks at the edge of their screen. |
getHeadFinalPitch
|
number |
Gets the pitch of the avatar's head relative to its body. |
getHeadFinalRoll
|
number |
Gets the roll of the avatar's head relative to its body. |
getHeadFinalYaw
|
number |
Gets the yaw of the avatar's head relative to its body. |
getHeadLookAt
|
Vec3 |
Gets the current target point of the head's look direction in world coordinates. |
getHeadPosition
|
Vec3 |
Gets the current position of the avatar's "Head" joint. |
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. |
getHmdAvatarAlignmentType
|
string |
Gets the HMD alignment relative to your avatar. |
getIKErrorOnLastSolve
|
number |
Gets the maximum error distance from the most recent inverse kinematics (IK) solution. |
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. |
getJointPosition
|
Vec3 |
Gets the position of a joint in the current avatar. |
getJointPosition
|
Vec3 |
Gets the position of a joint 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. |
getLeftHandPose
|
Pose |
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). 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 |
getLeftHandPosition
|
Vec3 |
Gets the position of the avatar's left hand, relative to the avatar, as positioned by a hand controller (e.g., Oculus Touch or Vive). Note: The Leap Motion isn't part of the hand controller input system. (Instead, it manipulates the avatar's joints for hand animation.) |
getLeftHandTipPose
|
Pose |
Gets the pose (position, rotation, velocity, and angular velocity) of the avatar's left hand, relative to the avatar, as positioned by a hand controller (e.g., Oculus Touch or Vive), and translated 0.3m along the palm. Note: 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 Leap Motion, the return value's |
getLeftHandTipPosition
|
Vec3 |
Gets the position 0.3m in front of the left hand's position in the direction along the palm, in avatar coordinates, as positioned by a hand controller. |
getLeftPalmPosition
|
Vec3 |
Gets the position of the left palm in world coordinates. |
getLeftPalmRotation
|
Quat |
Gets the rotation of the left palm in world coordinates. |
getNeckPosition
|
Vec3 |
Gets the position of the current avatar's neck in world coordinates. |
getOrientationForAudio
|
Quat |
Gets the orientation of your listening position for spatialized audio. The orientation depends on the value of the audioListenerMode property. |
getOrientationVar
|
object |
Gets the avatar orientation. Suitable for use in QML. |
getOtherAvatarsCollisionsEnabled
|
boolean |
Gets whether the avatar will collide with other avatars. |
getParentID
|
Uuid |
Gets the ID of the entity or avatar that the avatar is parented to. |
getParentJointIndex
|
number |
Gets the joint of the entity or avatar that the avatar is parented to. |
getPositionForAudio
|
Vec3 |
Gets your listening position for spatialized audio. The position depends on the value of the audioListenerMode property. |
getRawDriveKey
|
number |
Gets the value of a drive key, regardless of whether it is disabled. |
getRightHandPose
|
Pose |
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). 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 |
getRightHandPosition
|
Vec3 |
Gets the position of the avatar's right hand, relative to the avatar, as positioned by a hand controller (e.g., Oculus Touch or Vive). Note: The Leap Motion isn't part of the hand controller input system. (Instead, it manipulates the avatar's joints for hand animation.) |
getRightHandTipPose
|
Pose |
Gets the pose (position, rotation, velocity, and angular velocity) of the avatar's right hand, relative to the avatar, as positioned by a hand controller (e.g., Oculus Touch or Vive), and translated 0.3m along the palm. Note: 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 Leap Motion, the return value's |
getRightHandTipPosition
|
Vec3 |
Gets the position 0.3m in front of the right hand's position in the direction along the palm, in avatar coordinates, as positioned by a hand controller. |
getRightPalmPosition
|
Vec3 |
Gets the position of the right palm in world coordinates. |
getRightPalmRotation
|
Quat |
Get the rotation of the right palm in world coordinates. |
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. |
getSimulationRate
|
number |
Deprecated: This function is deprecated and will be removed. |
getSkeleton
|
Array.<SkeletonJoint> |
Gets information on all the joints in the avatar's skeleton. |
getSkeletonOffset
|
Vec3 |
Gets the offset applied to the current avatar. The offset adjusts the position that the avatar is rendered. For example,
with an offset of |
getSnapTurn
|
boolean |
Gets whether you do snap turns in HMD mode. |
getStrafeEnabled
|
boolean |
Gets whether strafing is enabled. |
getTargetAvatar
|
ScriptAvatar |
Gets information on the avatar your avatar is currently looking at. |
getTargetAvatarPosition
|
Vec3 |
Gets the position of the avatar your avatar is currently looking at. |
getTargetScale
|
number |
Gets the target scale of the avatar without any restrictions on permissible values imposed by the domain. In contrast, the
|
getThrust
|
Vec3 |
Gets the thrust currently being applied to your avatar. Deprecated: This function is deprecated and will be removed. Use MyAvatar.motorVelocity and related properties instead. |
getTriggerReactions
|
Array.<string> |
Gets the list of reactions names that can be triggered using MyAvatar.triggerReaction. See also: MyAvatar.getBeginEndReactions. |
getUpdateRate
|
number |
Gets the update rate of avatar mixer data being generated by the avatar. |
getWorldFeetPosition
|
Vec3 |
Gets the position of the current avatar's feet (or rather, bottom of its collision capsule) in world coordinates. |
goToFeetLocation
|
None |
Moves the avatar to a new position and/or orientation in the domain, with safe landing, while taking into account avatar leg length. |
goToLocation
|
None |
Moves the avatar to a new position and/or orientation in the domain. |
goToLocation
|
None |
Moves the avatar to a new position and (optional) orientation in the domain, with safe landing. |
goToLocationAndEnableCollisions
|
None |
Moves the avatar to a new position, with safe landing, and enables collisions. |
grab
|
Uuid |
Creates a new grab that grabs an entity. |
hoverWhenUnsupported
|
boolean |
Gets whether your avatar hovers when its feet are not on the ground. |
increaseSize
|
None |
Increases the avatar's scale by five percent, up to a minimum scale of |
isDown
|
boolean |
Tests whether a vector is pointing in the general direction of the avatar's "down" direction (i.e., dot product of
vectors is |
isDriveKeyDisabled
|
boolean |
Checks whether a drive key is disabled. |
isFlying
|
boolean |
Checks whether your avatar is flying. |
isInAir
|
boolean |
Checks whether your avatar is in the air. |
isJointDataValid
|
boolean |
Checks that the data for a joint are valid. |
isJointDataValid
|
boolean |
Checks if the data for a joint are valid. |
isRecenteringHorizontally
|
boolean |
Gets whether the avatar is configured to keep its center of gravity under its head. |
isSeated
|
boolean |
Gets whether the avatar is in a seated pose. The seated pose is set by calling MyAvatar.beginSit. |
isUp
|
boolean |
Tests whether a vector is pointing in the general direction of the avatar's "up" direction (i.e., dot product of vectors
is |
jointToWorldDirection
|
Vec3 |
Transforms a direction in a joint's coordinates, or avatar coordinates if no joint is specified, to a direction in world coordinates. |
jointToWorldPoint
|
Vec3 |
Transforms a position in a joint's coordinates, or avatar coordinates if no joint is specified, to a position in world coordinates. |
jointToWorldRotation
|
Quat |
Transforms a rotation in a joint's coordinates, or avatar coordinates if no joint is specified, to a rotation in world coordinates. |
overrideAnimation
|
None |
Overrides the default avatar animations. 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. |
overrideHandAnimation
|
None |
Overrides the default hand poses that are triggered with controller buttons. Use MyAvatar.restoreHandAnimation to restore the default poses. |
overrideRoleAnimation
|
None |
Overrides a specific animation role. 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", and "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. |
pinJoint
|
boolean |
Sets and locks a joint's position and orientation. Note: Only works on the hips joint. |
releaseEyesLookAtControl
|
None |
Returns control of the avatar's eyes to the engine, and releases control from API calls. |
releaseGrab
|
None |
Releases (deletes) a grab to stop grabbing an entity. |
releaseHeadLookAtControl
|
None |
Returns control of the avatar's head to the engine, and releases control from API calls. |
removeAnimationStateHandler
|
None |
Removes an animation state handler function. |
requestDisableHandTouch
|
None |
Requests that the hand touch effect is enabled for your avatar. Any resulting change in the status of the hand touch effect will be signaled by MyAvatar.shouldDisableHandTouchChanged. 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. |
requestEnableHandTouch
|
None |
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 MyAvatar.shouldDisableHandTouchChanged. 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. |
resetLastSent
|
None |
Deprecated: This function is deprecated and will be removed. |
resetSensorsAndBody
|
None |
Resets the sensor positioning of your HMD (if in use) and recenters your avatar body and head. |
resetSize
|
None |
Resets the avatar's scale back to the default scale of |
restoreAnimation
|
None |
Restores the default animations. 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. |
restoreHandAnimation
|
None |
Restores the default hand animation state machine that is driven by the state machine in the avatar-animation JSON. 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. |
restoreRoleAnimation
|
None |
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 |
restrictScaleFromDomainSettings
|
None |
Deprecated: This function is deprecated and will be removed. |
rigReady
|
None |
Deprecated: This function is deprecated and will be removed. |
rigReset
|
None |
Deprecated: This function is deprecated and will be removed. |
safeLanding
|
boolean |
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 |
setAnimGraphOverrideUrl
|
None |
Sets the animation graph to use in preference to the default animation graph. See Custom Avatar Animations for information on animation graphs. |
setAnimGraphUrl
|
None |
Sets the current animation graph (i.e., the avatar animation JSON) to use for avatar animations and makes it the default. See Custom Avatar Animations for information on animation graphs. |
setAvatarEntityData
|
None |
Sets all avatar entities from an object. |
setAvatarScale
|
None |
Sets the target scale of the avatar. The target scale is the desired scale of the avatar without any restrictions on permissible scale values imposed by the domain. |
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 |
setCenterOfGravityModelEnabled
|
None |
Sets whether the avatar's hips are balanced over the feet or positioned under the head. |
setCharacterControllerEnabled
|
None |
Deprecated: This function is deprecated and will be removed. Use MyAvatar.setCollisionsEnabled instead. |
setCollisionsEnabled
|
None |
Sets whether the avatar should collide with entities. Note: A |
setControlScheme
|
None |
Sets the control scheme to use. |
setDebugDrawAnimPoseName
|
None |
Sets the animation node to display when animation debug graphics are enabled with MyAvatar.setEnableDebugDrawAnimPose. |
setDominantHand
|
None |
Sets the avatar's dominant hand. |
setDriveGear1
|
None |
Set the first 'shifting point' for acceleration step function. |
setDriveGear2
|
None |
Set the second 'shifting point' for acceleration step function. |
setDriveGear3
|
None |
Set the third 'shifting point' for acceleration step function. |
setDriveGear4
|
None |
Set the fourth 'shifting point' for acceleration step function. |
setDriveGear5
|
None |
Set the fifth 'shifting point' for acceleration step function. |
setEnableDebugDrawAnimPose
|
None |
Displays animation debug graphics. By default, the animation poses used for rendering are displayed. However, MyAvatar.setDebugDrawAnimPoseName can be used to set a specific animation node to display. |
setEnableDebugDrawBaseOfSupport
|
None |
Displays the base of support area debug graphics if in HMD mode. If your head goes outside this area your avatar's hips are moved to counterbalance your avatar, and if your head moves too far then your avatar's position is moved (i.e., a step happens). |
setEnableDebugDrawDefaultPose
|
None |
Displays default pose debug graphics. |
setEnableDebugDrawDetailedCollision
|
None |
Displays detailed collision debug graphics. |
setEnableDebugDrawHandControllers
|
None |
Displays controller hand target debug graphics. |
setEnableDebugDrawIKChains
|
None |
Displays inverse kinematics chains debug graphics. |
setEnableDebugDrawIKConstraints
|
None |
Displays inverse kinematics constraints debug graphics. |
setEnableDebugDrawIKTargets
|
None |
Displays inverse kinematics targets debug graphics. |
setEnableDebugDrawPosition
|
None |
Displays position debug graphics. |
setEnableDebugDrawSensorToWorldMatrix
|
None |
Displays sensor-to-world matrix debug graphics. |
setEnableInverseKinematics
|
None |
Sets whether inverse kinematics (IK) is enabled for your avatar. |
setEnableMeshVisible
|
None |
Sets whether your avatar mesh is visible to you. |
setEyesLookAt
|
None |
Forces the avatar's eyes to look at a specified location. Once this method is called, API calls full control of the eyes for a limited time. If this method is not called for 2 seconds, the engine regains control of the eyes. |
setFlyingDesktopPref
|
None |
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. |
setFlyingEnabled
|
None |
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. |
setFlyingHMDPref
|
None |
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. |
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
|
setGravity
|
None |
Sets the amount of gravity applied to the avatar in the y-axis direction. (Negative values are downward.) |
setHMDLeanRecenterEnabled
|
None |
Sets whether the avatar's position updates to recenter the avatar under the head. In room-scale VR, recentering causes your avatar to follow your HMD as you walk around the room. Disabling recentering is useful if you want to pin the avatar to a fixed position. |
setHandRelativeMovement
|
None |
Set your preference for hand-relative movement. |
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. |
setHeadLookAt
|
None |
Turns the avatar's head until it faces the target point within a +90/-90 degree range. Once this method is called, API calls have full control of the head for a limited time. If this method is not called for 2 seconds, the engine regains control of the head. |
setHmdAvatarAlignmentType
|
None |
Sets the HMD alignment relative to your avatar. |
setHoverWhenUnsupported
|
None |
Sets whether your avatar hovers when its feet are not on the ground. |
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. |
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. |
setModelScale
|
None |
Deprecated: This function is deprecated and will be removed. |
setModelURLFinished
|
None |
Deprecated: This function is deprecated and will be removed. |
setOrientationVar
|
None |
Gets the avatar orientation. Suitable for use in QML. |
setOtherAvatarsCollisionsEnabled
|
None |
Sets whether the avatar should collide with other avatars. |
setParentID
|
None |
Sets the ID of the entity or avatar that the avatar is parented to. |
setParentJointIndex
|
None |
Sets the joint of the entity or avatar that the avatar is parented to. |
setPointAt
|
boolean |
Sets the point-at target for the Note: The |
setSessionUUID
|
None |
Deprecated: This function is deprecated and will be removed. |
setSkeletonModelURL
|
None |
Sets the avatar's skeleton model. |
setSkeletonOffset
|
None |
Sets the offset applied to the current avatar. The offset adjusts the position that the avatar is rendered. For example,
with an offset of |
setSnapTurn
|
None |
Sets whether you do snap turns or smooth turns in HMD mode. |
setStrafeEnabled
|
None |
Sets whether strafing is enabled. |
setThrust
|
None |
Sets the thrust to be applied to your avatar for a short while. Deprecated: This function is deprecated and will be removed. Use MyAvatar.motorVelocity and related properties instead. |
setToggleHips
|
None |
Deprecated: This function is deprecated and will be removed. |
targetScaleChanged
|
Triggered when the avatar's target scale is changed. The target scale is the desired scale of the avatar without any restrictions on permissible scale values imposed by the domain. |
|
triggerHorizontalRecenter
|
None |
Recenter the avatar in the horizontal direction, if |
triggerReaction
|
boolean |
Plays a reaction on the avatar. Once the reaction is complete it will stop playing. Only reaction names returned by MyAvatar.getTriggerReactions are available. |
triggerRotationRecenter
|
None |
Recenter the avatar's rotation, if |
triggerVerticalRecenter
|
None |
Recenter the avatar in the vertical direction, if |
updateAvatarEntity
|
None |
Deprecated: This function is deprecated and will be removed. |
updateMotionBehaviorFromMenu
|
None |
Updates avatar motion behavior from the Developer > Avatar > Enable Default Motor Control and Enable Scripted Motor Control menu items. |
useFlow
|
None |
Enables and disables flow simulation of physics on the avatar's hair, clothes, and body parts. See Add Flow to Your Avatar for more information. |
useFullAvatarURL
|
None |
Changes the user's avatar and associated descriptive name. |
worldToJointDirection
|
Vec3 |
Transforms a direction in world coordinates to a direction in a joint's coordinates, or avatar coordinates if no joint is specified. |
worldToJointPoint
|
Vec3 |
Transforms a position in world coordinates to a position in a joint's coordinates, or avatar coordinates if no joint is specified. |
worldToJointRotation
|
Quat |
Transforms a rotation in world coordinates to a rotation in a joint's coordinates, or avatar coordinates if no joint is specified. |
Signals
Name | Summary |
---|---|
analogPlusSprintSpeedChanged
|
Triggered when the sprint (run) speed set for the "AnalogPlus" control scheme changes. |
analogPlusWalkSpeedChanged
|
Triggered when the walk speed set for the "AnalogPlus" control scheme changes. |
animGraphUrlChanged
|
Triggered when the avatar's animation graph being used changes. |
audioListenerModeChanged
|
Triggered when the audioListenerMode property value changes. |
collisionWithEntity
|
Triggered when the avatar collides with an entity. |
collisionsEnabledChanged
|
Triggered when collisions with the environment are enabled or disabled. |
disableHandTouchForIDChanged
|
Triggered when the hand touch is enabled or disabled on a specific entity. 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. |
displayNameChanged
|
Triggered when the avatar's |
dominantHandChanged
|
Triggered when the avatar's dominant hand changes. |
energyChanged
|
Deprecated: This signal is deprecated and will be removed. |
hmdAvatarAlignmentTypeChanged
|
Triggered when the HMD alignment for your avatar changes. |
lookAtSnappingChanged
|
Triggered when the avatar's |
newCollisionSoundURL
|
Triggered when the collisionSoundURL property value changes. |
onLoadComplete
|
Triggered when the avatar's model finishes loading. |
onLoadFailed
|
Triggered when the avatar's model has failed to load. |
otherAvatarsCollisionsEnabledChanged
|
Triggered when collisions with other avatars are enabled or disabled. |
positionGoneTo
|
Triggered when the avatar has been moved to a new position by one of the MyAvatar "goTo" functions. |
scaleChanged
|
Triggered when the avatar's size changes. This can be due to the user changing the size of their avatar or the domain limiting the size of their avatar. |
sensorToWorldScaleChanged
|
Triggered when the avatar's |
sessionDisplayNameChanged
|
Triggered when the avatar's |
sessionUUIDChanged
|
Triggered when the avatar's |
shouldDisableHandTouchChanged
|
Triggered when the hand touch effect is enabled or disabled for the avatar. 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. |
skeletonChanged
|
Triggered when the avatar's model (i.e., skeletonModelURL property value) is changed. Synonym of skeletonModelURLChanged. |
skeletonModelURLChanged
|
Triggered when the avatar's model (i.e., |
sprintSpeedChanged
|
Triggered when the sprint (run) speed set for the current control scheme (see getControlScheme) changes. |
transformChanged
|
Deprecated: This signal is deprecated and will be removed. |
walkBackwardSpeedChanged
|
Triggered when the walk backward speed set for the current control scheme (see getControlScheme) changes. |
wentActive
|
Triggered when your avatar changes from being away to being active. |
wentAway
|
Triggered when your avatar changes from being active to being away. |
Type Definitions
AnimIKSolutionSource Type: number |
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Specifies the initial conditions of the IK solver.
|
AnimOverlayBoneSet Type: number |
|||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Specifies sets of joints.
|
AnimStateDictionary Type: object |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
An Warning: These properties are subject to change.
Note: Rig coordinates are |
AvatarEntityData Type: object |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Information about an avatar entity.
|
CollisionCapsule Type: object |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A collision capsule is a cylinder with hemispherical ends. It is often used to approximate the extents of an avatar. Properties
|
FlowCollisionsData Type: object |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A set of collision options currently used in flow simulation. Properties
|
FlowCollisionsOptions Type: object |
||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Collision options to use in the flow simulation of a joint. Properties
|
FlowData Type: object |
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Flow options currently used in flow simulation. Properties
|
FlowPhysicsData Type: object |
|||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A set of physics options currently used in flow simulation. Properties
|
FlowPhysicsOptions Type: object |
||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Physics options to use in the flow simulation of a joint. Properties
|
GoToProperties Type: object |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A teleport target. Properties
|
IKTargetType Type: number |
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
An IK target type.
|
LocomotionControlsMode Type: number |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Locomotion control types.
|
SitStandModelType Type: number |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Specifies different avatar leaning and recentering behaviors. Deprecated: This type is deprecated and will be removed.
|
Method Details
(static) addAnimationStateHandler( handler, propertiesList ) → {number}
Returns: The ID of the animation state handler function if successfully added, undefined if not.
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Adds an animation state handler function that is invoked just before each animation graph update. More than one
animation state handler function may be added by calling The animation state handler function is called with an AnimStateDictionary
" A handler may change a value from Parameters
Example
|
(static) addThrust( thrust ) | ||||||
---|---|---|---|---|---|---|
Adds a thrust to your avatar's current thrust to be applied for a short while. Deprecated: This function is deprecated and will be removed. Use MyAvatar.motorVelocity and related properties instead. Parameters
|
(static) animGraphLoaded( ) |
---|
Deprecated: This function is deprecated and will be removed. |
(static) beginReaction( reactionName ) → {boolean}
Returns: true if the reaction was started, false if the reaction is not supported.
|
||||||
---|---|---|---|---|---|---|
Starts playing a reaction on the avatar. The reaction will continue to play until stopped using MyAvatar.endReaction or superseded by another reaction. Only reactions returned by MyAvatar.getBeginEndReactions are available. Parameters
|
(static) beginSit( position, rotation ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Starts a sitting action for the avatar. Parameters
|
(static) centerBody( ) |
---|
Moves and orients the avatar, such that it is directly underneath the HMD, with toes pointed forward in the direction of the HMD. |
(static) clearAvatarEntity( entityID, requiresRemovalFromTreeopt ) | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) clearIKJointLimitHistory( ) |
---|
Clears inverse kinematics joint limit history. 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, e.g., after finishing with an override animation. |
(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) clearPinOnJoint( index ) → {boolean}
Returns: true if the joint was unpinned, false if it wasn't.
|
||||||
---|---|---|---|---|---|---|
Clears a lock on a joint's position and orientation, as set by pinJoint. Note: Only works on the hips joint. Parameters
|
(static) clearScaleRestriction( ) |
---|
Deprecated: This function is deprecated and will be removed. |
(static) decreaseSize( ) |
---|
Decreases the avatar's scale by five percent, down to a minimum scale of Example
|
(static) disableDriveKey( key ) | ||||||
---|---|---|---|---|---|---|
Disables the action associated with a drive key. Parameters
Example
|
(static) disableHandTouchForID( entityID ) | ||||||
---|---|---|---|---|---|---|
Disables the hand touch effect on a specific entity. 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. Parameters
|
(static) enableDriveKey( key ) | ||||||
---|---|---|---|---|---|---|
Enables the action associated with a drive key. The action may have been disabled with disableDriveKey. Parameters
|
(static) enableHandTouchForID( entityID ) | ||||||
---|---|---|---|---|---|---|
Enables the hand touch effect on a specific entity. 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. Parameters
|
(static) endReaction( reactionName ) → {boolean}
Returns: true if the reaction was stopped, false if the reaction is not supported.
|
||||||
---|---|---|---|---|---|---|
Stops playing a reaction that was started using MyAvatar.beginReaction. Parameters
|
(static) endSit( position, rotation ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Ends a sitting action for the avatar. Parameters
|
(static) getAbsoluteDefaultJointRotationInObjectFrame( index ) → {Quat}
Returns: The default rotation of the joint in avatar coordinates. |
||||||
---|---|---|---|---|---|---|
Gets 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. Parameters
Example
|
(static) getAbsoluteDefaultJointTranslationInObjectFrame( index ) → {Vec3}
Returns: The default position of the joint in avatar coordinates. |
||||||
---|---|---|---|---|---|---|
Gets 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. Parameters
Example
|
(static) getAbsoluteJointRotationInObjectFrame( index ) → {Quat}
Returns: The rotation of the joint relative to the avatar. |
||||||
---|---|---|---|---|---|---|
Gets the rotation of a joint relative to the avatar. Parameters
Example
|
(static) getAbsoluteJointTranslationInObjectFrame( index ) → {Vec3}
Returns: The translation of the joint relative to the avatar. |
||||||
---|---|---|---|---|---|---|
Gets the translation of a joint relative to the avatar. Parameters
Example
|
(static) getAcceleration( ) → {Vec3}
Returns: The current acceleration of the avatar. |
---|
Gets the current acceleration of the avatar. |
(static) getAnimGraphOverrideUrl( ) → {string}
Returns: The URL of the override animation graph JSON file. "" if there is no override animation
graph.
|
---|
Gets the URL of the override animation graph. See Custom Avatar Animations for information on animation graphs. |
(static) getAnimGraphUrl( ) → {string}
Returns: The URL of the current animation graph JSON file. |
---|
Gets the URL of animation graph (i.e., the avatar animation JSON) that's currently being used for avatar animations. See Custom Avatar Animations for information on animation graphs. Example
|
(static) getAnimationRoles( ) → {Array.<string>}
Returns: Array of role strings. |
---|
Gets the current animation roles. 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 Example
|
(static) getAvatarEntitiesVariant( ) → {Array.<MyAvatar.AvatarEntityData>}
Returns: The current avatar entity IDs and their properties. |
---|
Gets the current avatar entity IDs and their properties. |
(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) getAvatarScale( ) → {number}
Returns: The target scale for the avatar, range 0.005 – 1000.0 .
|
---|
Gets the target scale of the avatar. The target scale is the desired scale of the avatar without any restrictions on permissible scale values imposed by the domain. |
(static) getBeginEndReactions( ) → {Array.<string>}
Returns: List of reaction names that can be enabled using MyAvatar.beginReaction and MyAvatar.endReaction. |
---|
Gets the list of reactions names that can be enabled using MyAvatar.beginReaction and MyAvatar.endReaction. See also: MyAvatar.getTriggerReactions. Example
|
(static) getCenterOfGravityModelEnabled( ) → {boolean}
Returns: true if the hips are being balanced over the feet, false if the hips are
being positioned under the head.
|
---|
Gets whether the avatar hips are being balanced over the feet or placed under the head. |
(static) getCharacterControllerEnabled( ) → {boolean}
Returns: true if the avatar will currently collide with entities, false if it won't.
|
---|
Deprecated: This function is deprecated and will be removed. Use MyAvatar.getCollisionsEnabled instead. |
(static) getCollidingFlowJoints( ) → {Array.<number>}
Returns: The indexes of currently colliding flow joints. |
---|
Gets the indexes of currently colliding flow joints. |
(static) getCollisionCapsule( ) → {MyAvatar.CollisionCapsule}
Returns: The avatar's collision capsule. |
---|
Gets the avatar's collision capsule: a cylinder with hemispherical ends that approximates the extents or the avatar. Warning: The values returned are in world coordinates but aren't necessarily up to date with the avatar's current position. |
(static) getCollisionsEnabled( ) → {boolean}
Returns: true if the avatar will currently collide with entities, false if it won't.
|
---|
Gets whether the avatar will currently collide with entities. Note: The avatar will always collide with entities if in a zone that disallows collisionless avatars. |
(static) getControlScheme( ) → {MyAvatar.LocomotionControlsMode}
Returns: The control scheme that is in use. |
---|
Gets the control scheme that is in use. |
(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) getDefaultEyePosition( ) → {Vec3}
Returns: Default position between your avatar's eyes in world coordinates. |
---|
Gets the position in world coordinates of the point directly between your avatar's eyes assuming your avatar was in its default pose. This is a reference position; it does not change as your avatar's head moves relative to the avatar position. Example
|
(static) getDefaultJointRotation( index ) → {Quat}
Returns: The default rotation of the joint if the joint index is valid, otherwise Quat.IDENTITY. |
||||||
---|---|---|---|---|---|---|
Gets the default rotation of a joint (in the current avatar) relative to its parent. For information on the joint hierarchy used, see Avatar Standards. Parameters
|
(static) getDefaultJointTranslation( index ) → {Vec3}
Returns: The default translation of the joint (in model coordinates) if the joint index is valid, otherwise Vec3.ZERO. |
||||||
---|---|---|---|---|---|---|
Gets the default translation of a joint (in the current avatar) 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) 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) getDominantHand( ) → {string}
Returns: "left" for the left hand, "right" for the right hand.
|
---|
Gets the avatar's dominant hand. |
(static) getDriveGear1( ) → {number}
Returns: Value between [0.0, 1.0]. |
---|
Get the first 'shifting point' for acceleration step function. |
(static) getDriveGear2( ) → {number}
Returns: Value between [0.0, 1.0]. |
---|
Get the second 'shifting point' for acceleration step function. |
(static) getDriveGear3( ) → {number}
Returns: Value between [0.0, 1.0]. |
---|
Get the third 'shifting point' for acceleration step function. |
(static) getDriveGear4( ) → {number}
Returns: Value between [0.0, 1.0]. |
---|
Get the fourth 'shifting point' for acceleration step function. |
(static) getDriveGear5( ) → {number}
Returns: Value between [0.0, 1.0]. |
---|
Get the fifth 'shifting point' for acceleration step function. |
(static) getEnableMeshVisible( ) → {boolean}
Returns: true if your avatar's mesh is visible, otherwise false .
|
---|
Gets whether your avatar mesh is visible. |
(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) getEyePosition( ) → {Vec3}
Returns: The current position of the point directly between the avatar's eyes. |
---|
Gets the current position of the point directly between the avatar's eyes. Example
|
(static) getEyesLookAt( ) → {Vec3}
Returns: The eyes' look-at target in world coordinates. |
---|
Gets the current target point of the eyes look direction in world coordinates. |
(static) getFlowData( ) → {MyAvatar.FlowData}
Returns: MyAvatar.FlowData |
---|
Gets the current flow configuration. |
(static) getFlyingDesktopPref( ) → {boolean}
Returns: true if your preference is to enable flying in desktop display mode, otherwise
false .
|
---|
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. |
(static) getFlyingEnabled( ) → {boolean}
Returns: true if your preference is to enable flying in your current desktop or HMD display mode,
otherwise false .
|
---|
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. |
(static) getFlyingHMDPref( ) → {boolean}
Returns: true if your preference is to enable flying in HMD display mode, otherwise
false .
|
---|
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. |
(static) getFullAvatarModelName( ) → {string}
Returns: The full avatar model name. |
---|
Gets the full avatar model name for the current avatar. Example
|
(static) getFullAvatarURLFromPreferences( ) → {string}
Returns: The full avatar model name. |
---|
Gets the complete URL for the current avatar. Example
|
(static) getGravity( ) → {number}
Returns: The amount of gravity currently applied to the avatar, in m/s2. |
---|
Sets the amount of gravity applied to the avatar in the y-axis direction. (Negative values are downward.) The default
value is |
(static) getHMDLeanRecenterEnabled( ) → {boolean}
Returns: true if recentering is enabled, false if not.
|
---|
Gets whether the avatar's position updates to recenter the avatar under the head. In room-scale VR, recentering causes your avatar to follow your HMD as you walk around the room. |
(static) getHandRelativeMovement( ) → {number}
Returns: true if your preference is for user locomotion to be relative to the direction your
controller is pointing, otherwise false .
|
---|
Get your preference for hand-relative movement. |
(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) getHeadDeltaPitch( ) → {number}
Returns: The pitch that the avatar's head should be if a face tracker is connected and being used, otherwise 0 , in degrees.
|
---|
If a face tracker is connected and being used, gets the estimated pitch of the user's head scaled. This is scale such that the avatar looks at the edge of the view frustum when the user looks at the edge of their screen. |
(static) getHeadFinalPitch( ) → {number}
Returns: The pitch of the avatar's head, in degrees. |
---|
Gets the pitch of the avatar's head relative to its body. |
(static) getHeadFinalRoll( ) → {number}
Returns: The roll of the avatar's head, in degrees. |
---|
Gets the roll of the avatar's head relative to its body. |
(static) getHeadFinalYaw( ) → {number}
Returns: The yaw of the avatar's head, in degrees. |
---|
Gets the yaw of the avatar's head relative to its body. |
(static) getHeadLookAt( ) → {Vec3}
Returns: The head's look-at target in world coordinates. |
---|
Gets the current target point of the head's look direction in world coordinates. |
(static) getHeadPosition( ) → {Vec3}
Returns: The current position of the avatar's "Head" joint. |
---|
Gets the current position of the avatar's "Head" joint. Example
|
(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) getHmdAvatarAlignmentType( ) → {string}
Returns: "head" if aligning your head and your avatar's head, "eyes" if aligning your
eyes and your avatar's eyes.
|
---|
Gets the HMD alignment relative to your avatar. |
(static) getIKErrorOnLastSolve( ) → {number}
Returns: The maximum IK error distance. |
---|
Gets the maximum error distance from the most recent inverse kinematics (IK) solution. |
(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) getJointPosition( index ) → {Vec3}
Returns: The position of the joint in world coordinates. |
||||||
---|---|---|---|---|---|---|
Gets the position of a joint in the current avatar. Parameters
|
(static) getJointPosition( name ) → {Vec3}
Returns: The position of the joint in world coordinates. |
||||||
---|---|---|---|---|---|---|
Gets the position of a joint in the current avatar. Parameters
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) getLeftHandPose( ) → {Pose}
Returns: The pose of the avatar's left hand, relative to the avatar, as positioned by a hand controller. |
---|
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). 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 Example
|
(static) getLeftHandPosition( ) → {Vec3}
Returns: The position of the left hand in avatar coordinates if positioned by a hand controller, otherwise Vec3.ZERO .
|
---|
Gets the position of the avatar's left hand, relative to the avatar, as positioned by a hand controller (e.g., Oculus Touch or Vive). Note: The Leap Motion isn't part of the hand controller input system. (Instead, it manipulates the avatar's joints for hand animation.) Example
|
(static) getLeftHandTipPose( ) → {Pose}
Returns: The pose of the avatar's left hand, relative to the avatar, as positioned by a hand controller, and translated 0.3m along the palm. |
---|
Gets the pose (position, rotation, velocity, and angular velocity) of the avatar's left hand, relative to the avatar, as positioned by a hand controller (e.g., Oculus Touch or Vive), and translated 0.3m along the palm. Note: 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 Leap Motion, the return value's |
(static) getLeftHandTipPosition( ) → {Vec3}
Returns: The position 0.3m in front of the left hand's position in the direction along the palm, in avatar coordinates. If the hand isn't being positioned by a controller, Vec3.ZERO is returned.
|
---|
Gets the position 0.3m in front of the left hand's position in the direction along the palm, in avatar coordinates, as positioned by a hand controller. |
(static) getLeftPalmPosition( ) → {Vec3}
Returns: The position of the left palm in world coordinates. |
---|
Gets the position of the left palm in world coordinates. Example
|
(static) getLeftPalmRotation( ) → {Quat}
Returns: The rotation of the left palm in world coordinates. |
---|
Gets the rotation of the left palm in world coordinates. Example
|
(static) getNeckPosition( ) → {Vec3}
Returns: The position of the neck in world coordinates. |
---|
Gets the position of the current avatar's neck in world coordinates. Example
|
(static) getOrientationForAudio( ) → {Quat}
Returns: The orientation of your listening position. |
---|
Gets the orientation of your listening position for spatialized audio. The orientation depends on the value of the audioListenerMode property. |
(static) getOrientationVar( ) → {object}
Returns: The avatar's orientation. |
---|
Gets the avatar orientation. Suitable for use in QML. |
(static) getOtherAvatarsCollisionsEnabled( ) → {boolean}
Returns: true if the avatar will collide with other avatars, false if it won't.
|
---|
Gets whether the avatar will collide with other avatars. |
(static) getParentID( ) → {Uuid}
Returns: The ID of the entity or avatar that the avatar is parented to. Uuid.NONE if not parented. |
---|
Gets the ID of the entity or avatar that the avatar is parented to. |
(static) getParentJointIndex( ) → {number}
Returns: The joint of the entity or avatar that the avatar is parented to. 65535 or
-1 if parented to the entity or avatar's position and orientation rather than a joint.
|
---|
Gets the joint of the entity or avatar that the avatar is parented to. |
(static) getPositionForAudio( ) → {Vec3}
Returns: Your listening position. |
---|
Gets your listening position for spatialized audio. The position depends on the value of the audioListenerMode property. |
(static) getRawDriveKey( key ) → {number}
Returns: The value of the drive key. |
||||||
---|---|---|---|---|---|---|
Gets the value of a drive key, regardless of whether it is disabled. Parameters
|
(static) getRightHandPose( ) → {Pose}
Returns: The pose of the avatar's right hand, relative to the avatar, as positioned by a hand controller. |
---|
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). 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 Example
|
(static) getRightHandPosition( ) → {Vec3}
Returns: The position of the right hand in avatar coordinates if positioned by a hand controller, otherwise Vec3.ZERO .
|
---|
Gets the position of the avatar's right hand, relative to the avatar, as positioned by a hand controller (e.g., Oculus Touch or Vive). Note: The Leap Motion isn't part of the hand controller input system. (Instead, it manipulates the avatar's joints for hand animation.) Example
|
(static) getRightHandTipPose( ) → {Pose}
Returns: The pose of the avatar's right hand, relative to the avatar, as positioned by a hand controller, and translated 0.3m along the palm. |
---|
Gets the pose (position, rotation, velocity, and angular velocity) of the avatar's right hand, relative to the avatar, as positioned by a hand controller (e.g., Oculus Touch or Vive), and translated 0.3m along the palm. Note: 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 Leap Motion, the return value's |
(static) getRightHandTipPosition( ) → {Vec3}
Returns: The position 0.3m in front of the right hand's position in the direction along the palm, in avatar coordinates. If the hand isn't being positioned by a controller, Vec3.ZERO is returned.
|
---|
Gets the position 0.3m in front of the right hand's position in the direction along the palm, in avatar coordinates, as positioned by a hand controller. |
(static) getRightPalmPosition( ) → {Vec3}
Returns: The position of the right palm in world coordinates. |
---|
Gets the position of the right palm in world coordinates. Example
|
(static) getRightPalmRotation( ) → {Quat}
Returns: The rotation of the right palm in world coordinates. |
---|
Get the rotation of the right palm in world coordinates. Example
|
(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) getSimulationRate( rateNameopt ) → {number}
Returns: Simulation rate in Hz. |
||||||||||
---|---|---|---|---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) getSkeleton( ) → {Array.<SkeletonJoint>}
Returns: Information about each joint in the avatar's skeleton. |
---|
Gets information on all the joints in the avatar's skeleton. |
(static) getSkeletonOffset( ) → {Vec3}
Returns: The current skeleton offset. |
---|
Gets the offset applied to the current avatar. The offset adjusts the position that the avatar is rendered. For example,
with an offset of Example
|
(static) getSnapTurn( ) → {boolean}
Returns: true if you do snap turns in HMD mode; false if you do smooth turns in HMD
mode.
|
---|
Gets whether you do snap turns in HMD mode. |
(static) getStrafeEnabled( ) → {boolean}
Returns: true if strafing is enabled, false if it isn't.
|
---|
Gets whether strafing is enabled. |
(static) getTargetAvatar( ) → {ScriptAvatar}
Returns: Information on the avatar being looked at, null if no avatar is being looked at.
|
---|
Gets information on the avatar your avatar is currently looking at. |
(static) getTargetAvatarPosition( ) → {Vec3}
Returns: The position of the avatar beeing looked at. |
---|
Gets the position of the avatar your avatar is currently looking at. Example
|
(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) getThrust( ) → {Vec3}
Returns: The thrust currently being applied to your avatar. |
---|
Gets the thrust currently being applied to your avatar. Deprecated: This function is deprecated and will be removed. Use MyAvatar.motorVelocity and related properties instead. |
(static) getTriggerReactions( ) → {Array.<string>}
Returns: List of reaction names that can be triggered using MyAvatar.triggerReaction. |
---|
Gets the list of reactions names that can be triggered using MyAvatar.triggerReaction. See also: MyAvatar.getBeginEndReactions. 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) getWorldFeetPosition( ) → {Vec3}
Returns: The position of the avatar's feet in world coordinates. |
---|
Gets the position of the current avatar's feet (or rather, bottom of its collision capsule) in world coordinates. |
(static) goToFeetLocation( position, hasOrientationopt, orientationopt, shouldFaceLocationopt ) | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Moves the avatar to a new position and/or orientation in the domain, with safe landing, while taking into account avatar leg length. Parameters
|
(static) goToLocation( position, hasOrientationopt, orientationopt, shouldFaceLocationopt, withSafeLandingopt ) | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Moves the avatar to a new position and/or orientation in the domain. Parameters
|
(static) goToLocation( target ) | ||||||
---|---|---|---|---|---|---|
Moves the avatar to a new position and (optional) orientation in the domain, with safe landing. Parameters
|
(static) goToLocationAndEnableCollisions( position ) | ||||||
---|---|---|---|---|---|---|
Moves the avatar to a new position, with safe landing, and enables collisions. Parameters
|
(static) grab( targetID, parentJointIndex, offset, rotationalOffset ) → {Uuid}
Returns: The ID of the new grab. |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new grab that grabs an entity. Parameters
Example
|
(static) hoverWhenUnsupported( ) → {boolean}
Returns: true if your avatar hovers when its feet are not on the ground, false if it
falls.
|
---|
Gets whether your avatar hovers when its feet are not on the ground. |
(static) increaseSize( ) |
---|
Increases the avatar's scale by five percent, up to a minimum scale of Example
|
(static) isDown( direction ) → {boolean}
Returns: true if the direction vector is pointing generally in the direction of the avatar's
"down" direction.
|
||||||
---|---|---|---|---|---|---|
Tests whether a vector is pointing in the general direction of the avatar's "down" direction (i.e., dot product of
vectors is Parameters
|
(static) isDriveKeyDisabled( key ) → {boolean}
Returns: true if the drive key is disabled, false if it isn't.
|
||||||
---|---|---|---|---|---|---|
Checks whether a drive key is disabled. Parameters
|
(static) isFlying( ) → {boolean}
Returns: true if your avatar is flying and not taking off or falling, false if not.
|
---|
Checks whether your avatar is flying. |
(static) isInAir( ) → {boolean}
Returns: true if your avatar is taking off, flying, or falling, otherwise false
because your avatar is on the ground.
|
---|
Checks whether your avatar is in the air. |
(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) isRecenteringHorizontally( ) → {boolean}
Returns: true if the avatar is keeping its center of gravity under its head position,
false if not.
|
---|
Gets whether the avatar is configured to keep its center of gravity under its head. |
(static) isSeated( ) → {boolean}
Returns: true if the avatar is in a seated pose, false if it isn't.
|
---|
Gets whether the avatar is in a seated pose. The seated pose is set by calling MyAvatar.beginSit. |
(static) isUp( direction ) → {boolean}
Returns: true if the direction vector is pointing generally in the direction of the avatar's "up"
direction.
|
||||||
---|---|---|---|---|---|---|
Tests whether a vector is pointing in the general direction of the avatar's "up" direction (i.e., dot product of vectors
is Parameters
|
(static) jointToWorldDirection( direction, jointIndexopt ) → {Vec3}
Returns: The direction in world coordinates. |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Transforms a direction in a joint's coordinates, or avatar coordinates if no joint is specified, to a direction in world coordinates. Parameters
|
(static) jointToWorldPoint( position, jointIndexopt ) → {Vec3}
Returns: The position in world coordinates. |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Transforms a position in a joint's coordinates, or avatar coordinates if no joint is specified, to a position in world coordinates. Parameters
|
(static) jointToWorldRotation( rotation, jointIndexopt ) → {Quat}
Returns: The rotation in world coordinates. |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Transforms a rotation in a joint's coordinates, or avatar coordinates if no joint is specified, to a rotation in world coordinates. Parameters
|
(static) overrideAnimation( url, fps, loop, firstFrame, lastFrame ) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Overrides the default avatar animations. 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. Parameters
Example
|
(static) overrideHandAnimation( isLeft, url, fps, loop, firstFrame, lastFrame ) | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Overrides the default hand poses that are triggered with controller buttons. Use MyAvatar.restoreHandAnimation to restore the default poses. Parameters
Example
|
(static) overrideRoleAnimation( role, url, fps, loop, firstFrame, lastFrame ) | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Overrides a specific animation role. 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", and "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. Parameters
Example
|
(static) pinJoint( index, position, orientation ) → {boolean}
Returns: true if the joint was pinned, false if it wasn't.
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets and locks a joint's position and orientation. Note: Only works on the hips joint. Parameters
|
(static) releaseEyesLookAtControl( ) |
---|
Returns control of the avatar's eyes to the engine, and releases control from API calls. |
(static) releaseGrab( grabID ) | ||||||
---|---|---|---|---|---|---|
Releases (deletes) a grab to stop grabbing an entity. Parameters
|
(static) releaseHeadLookAtControl( ) |
---|
Returns control of the avatar's head to the engine, and releases control from API calls. |
(static) removeAnimationStateHandler( handler ) | ||||||
---|---|---|---|---|---|---|
Removes an animation state handler function. Parameters
|
(static) requestDisableHandTouch( ) |
---|
Requests that the hand touch effect is enabled for your avatar. Any resulting change in the status of the hand touch effect will be signaled by MyAvatar.shouldDisableHandTouchChanged. 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. |
(static) requestEnableHandTouch( ) |
---|
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 MyAvatar.shouldDisableHandTouchChanged. 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. |
(static) resetLastSent( ) |
---|
Deprecated: This function is deprecated and will be removed. |
(static) resetSensorsAndBody( ) |
---|
Resets the sensor positioning of your HMD (if in use) and recenters your avatar body and head. |
(static) resetSize( ) |
---|
Resets the avatar's scale back to the default scale of |
(static) restoreAnimation( ) |
---|
Restores the default animations. 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. Example
|
(static) restoreHandAnimation( isLeft ) | ||||||
---|---|---|---|---|---|---|
Restores the default hand animation state machine that is driven by the state machine in the avatar-animation JSON. 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. Parameters
Example
|
(static) restoreRoleAnimation( role ) | ||||||
---|---|---|---|---|---|---|
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 Parameters
|
(static) restrictScaleFromDomainSettings( domainSettings ) | ||||||
---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) rigReady( ) |
---|
Deprecated: This function is deprecated and will be removed. |
(static) rigReset( ) |
---|
Deprecated: This function is deprecated and will be removed. |
(static) safeLanding( position ) → {boolean}
Returns: true if the avatar was moved, false if it wasn't.
|
||||||
---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(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) setAnimGraphOverrideUrl( url ) | ||||||
---|---|---|---|---|---|---|
Sets the animation graph to use in preference to the default animation graph. See Custom Avatar Animations for information on animation graphs. Parameters
|
(static) setAnimGraphUrl( url ) | ||||||
---|---|---|---|---|---|---|
Sets the current animation graph (i.e., the avatar animation JSON) to use for avatar animations and makes it the default. See Custom Avatar Animations for information on animation graphs. Parameters
|
(static) setAvatarEntityData( avatarEntityData ) | ||||||
---|---|---|---|---|---|---|
Sets all avatar entities from an object. Parameters
|
(static) setAvatarScale( scale ) | ||||||
---|---|---|---|---|---|---|
Sets the target scale of the avatar. The target scale is the desired scale of the avatar without any restrictions on permissible scale values imposed by the domain. 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) setCenterOfGravityModelEnabled( enabled ) | ||||||
---|---|---|---|---|---|---|
Sets whether the avatar's hips are balanced over the feet or positioned under the head. Parameters
|
(static) setCharacterControllerEnabled( enabled ) | ||||||
---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Use MyAvatar.setCollisionsEnabled instead. Parameters
|
(static) setCollisionsEnabled( enabled ) | ||||||
---|---|---|---|---|---|---|
Sets whether the avatar should collide with entities. Note: A Parameters
|
(static) setControlScheme( controlScheme ) | ||||||
---|---|---|---|---|---|---|
Sets the control scheme to use. Parameters
|
(static) setDebugDrawAnimPoseName( poseName ) | ||||||
---|---|---|---|---|---|---|
Sets the animation node to display when animation debug graphics are enabled with MyAvatar.setEnableDebugDrawAnimPose. Parameters
|
(static) setDominantHand( hand ) | ||||||
---|---|---|---|---|---|---|
Sets the avatar's dominant hand. Parameters
|
(static) setDriveGear1( shiftPoint ) | ||||||
---|---|---|---|---|---|---|
Set the first 'shifting point' for acceleration step function. Parameters
|
(static) setDriveGear2( shiftPoint ) | ||||||
---|---|---|---|---|---|---|
Set the second 'shifting point' for acceleration step function. Parameters
|
(static) setDriveGear3( shiftPoint ) | ||||||
---|---|---|---|---|---|---|
Set the third 'shifting point' for acceleration step function. Parameters
|
(static) setDriveGear4( shiftPoint ) | ||||||
---|---|---|---|---|---|---|
Set the fourth 'shifting point' for acceleration step function. Parameters
|
(static) setDriveGear5( shiftPoint ) | ||||||
---|---|---|---|---|---|---|
Set the fifth 'shifting point' for acceleration step function. Parameters
|
(static) setEnableDebugDrawAnimPose( enabled ) | ||||||
---|---|---|---|---|---|---|
Displays animation debug graphics. By default, the animation poses used for rendering are displayed. However, MyAvatar.setDebugDrawAnimPoseName can be used to set a specific animation node to display. Parameters
|
(static) setEnableDebugDrawBaseOfSupport( enabled ) | ||||||
---|---|---|---|---|---|---|
Displays the base of support area debug graphics if in HMD mode. If your head goes outside this area your avatar's hips are moved to counterbalance your avatar, and if your head moves too far then your avatar's position is moved (i.e., a step happens). Parameters
|
(static) setEnableDebugDrawDefaultPose( enabled ) | ||||||
---|---|---|---|---|---|---|
Displays default pose debug graphics. Parameters
|
(static) setEnableDebugDrawDetailedCollision( enabled ) | ||||||
---|---|---|---|---|---|---|
Displays detailed collision debug graphics. Parameters
|
(static) setEnableDebugDrawHandControllers( enabled ) | ||||||
---|---|---|---|---|---|---|
Displays controller hand target debug graphics. Parameters
|
(static) setEnableDebugDrawIKChains( enabled ) | ||||||
---|---|---|---|---|---|---|
Displays inverse kinematics chains debug graphics. Parameters
|
(static) setEnableDebugDrawIKConstraints( enabled ) | ||||||
---|---|---|---|---|---|---|
Displays inverse kinematics constraints debug graphics. Parameters
|
(static) setEnableDebugDrawIKTargets( enabled ) | ||||||
---|---|---|---|---|---|---|
Displays inverse kinematics targets debug graphics. Parameters
|
(static) setEnableDebugDrawPosition( enabled ) | ||||||
---|---|---|---|---|---|---|
Displays position debug graphics. Parameters
|
(static) setEnableDebugDrawSensorToWorldMatrix( enable ) | ||||||
---|---|---|---|---|---|---|
Displays sensor-to-world matrix debug graphics. Parameters
|
(static) setEnableInverseKinematics( enabled ) | ||||||
---|---|---|---|---|---|---|
Sets whether inverse kinematics (IK) is enabled for your avatar. Parameters
|
(static) setEnableMeshVisible( enabled ) | ||||||
---|---|---|---|---|---|---|
Sets whether your avatar mesh is visible to you. Parameters
Example
|
(static) setEyesLookAt( lookAtTarget ) | ||||||
---|---|---|---|---|---|---|
Forces the avatar's eyes to look at a specified location. Once this method is called, API calls full control of the eyes for a limited time. If this method is not called for 2 seconds, the engine regains control of the eyes. Parameters
|
(static) setFlyingDesktopPref( enabled ) | ||||||
---|---|---|---|---|---|---|
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. Parameters
|
(static) setFlyingEnabled( enabled ) | ||||||
---|---|---|---|---|---|---|
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. Parameters
|
(static) setFlyingHMDPref( enabled ) | ||||||
---|---|---|---|---|---|---|
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. Parameters
|
(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) setGravity( gravity ) | ||||||
---|---|---|---|---|---|---|
Sets the amount of gravity applied to the avatar in the y-axis direction. (Negative values are downward.) Parameters
|
(static) setHMDLeanRecenterEnabled( enabled ) | ||||||
---|---|---|---|---|---|---|
Sets whether the avatar's position updates to recenter the avatar under the head. In room-scale VR, recentering causes your avatar to follow your HMD as you walk around the room. Disabling recentering is useful if you want to pin the avatar to a fixed position. Parameters
|
(static) setHandRelativeMovement( enabled ) | ||||||
---|---|---|---|---|---|---|
Set your preference for hand-relative movement. 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) setHeadLookAt( lookAtTarget ) | ||||||
---|---|---|---|---|---|---|
Turns the avatar's head until it faces the target point within a +90/-90 degree range. Once this method is called, API calls have full control of the head for a limited time. If this method is not called for 2 seconds, the engine regains control of the head. Parameters
|
(static) setHmdAvatarAlignmentType( type ) | ||||||
---|---|---|---|---|---|---|
Sets the HMD alignment relative to your avatar. Parameters
|
(static) setHoverWhenUnsupported( hover ) | ||||||
---|---|---|---|---|---|---|
Sets whether your avatar hovers when its feet are not on the ground. 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) 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) setModelScale( scale ) | ||||||
---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) setModelURLFinished( success ) | ||||||
---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) setOrientationVar( newOrientationVar ) | ||||||
---|---|---|---|---|---|---|
Gets the avatar orientation. Suitable for use in QML. Parameters
|
(static) setOtherAvatarsCollisionsEnabled( enabled ) | ||||||
---|---|---|---|---|---|---|
Sets whether the avatar should collide with other avatars. Parameters
|
(static) setParentID( parentID ) | ||||||
---|---|---|---|---|---|---|
Sets the ID of the entity or avatar that the avatar is parented to. Parameters
|
(static) setParentJointIndex( parentJointIndex ) | ||||||
---|---|---|---|---|---|---|
Sets the joint of the entity or avatar that the avatar is parented to. Parameters
|
(static) setPointAt( pointAtTarget ) → {boolean}
Returns: true if the target point was set, false if it wasn't.
|
||||||
---|---|---|---|---|---|---|
Sets the point-at target for the Note: The 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) setSkeletonOffset( offset ) | ||||||
---|---|---|---|---|---|---|
Sets the offset applied to the current avatar. The offset adjusts the position that the avatar is rendered. For example,
with an offset of Parameters
Example
|
(static) setSnapTurn( on ) | ||||||
---|---|---|---|---|---|---|
Sets whether you do snap turns or smooth turns in HMD mode. Parameters
|
(static) setStrafeEnabled( enabled ) | ||||||
---|---|---|---|---|---|---|
Sets whether strafing is enabled. Parameters
|
(static) setThrust( thrust ) | ||||||
---|---|---|---|---|---|---|
Sets the thrust to be applied to your avatar for a short while. Deprecated: This function is deprecated and will be removed. Use MyAvatar.motorVelocity and related properties instead. Parameters
|
(static) setToggleHips( enabled ) | ||||||
---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) targetScaleChanged( targetScale )
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when the avatar's target scale is changed. The target scale is the desired scale of the avatar without any restrictions on permissible scale values imposed by the domain. Parameters
|
(static) triggerHorizontalRecenter( ) |
---|
Recenter the avatar in the horizontal direction, if |
(static) triggerReaction( reactionName ) → {boolean}
Returns: true if the reaction was played, false if the reaction is not supported.
|
||||||
---|---|---|---|---|---|---|
Plays a reaction on the avatar. Once the reaction is complete it will stop playing. Only reaction names returned by MyAvatar.getTriggerReactions are available. Parameters
|
(static) triggerRotationRecenter( ) |
---|
Recenter the avatar's rotation, if |
(static) triggerVerticalRecenter( ) |
---|
Recenter the avatar in the vertical direction, if |
(static) updateAvatarEntity( entityID, entityData ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Deprecated: This function is deprecated and will be removed. Parameters
|
(static) updateMotionBehaviorFromMenu( ) |
---|
Updates avatar motion behavior from the Developer > Avatar > Enable Default Motor Control and Enable Scripted Motor Control menu items. |
(static) useFlow( isActive, isCollidable, physicsConfigopt, collisionsConfigopt ) | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Enables and disables flow simulation of physics on the avatar's hair, clothes, and body parts. See Add Flow to Your Avatar for more information. Parameters
|
(static) useFullAvatarURL( fullAvatarURL, modelNameopt ) | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Changes the user's avatar and associated descriptive name. Parameters
|
(static) worldToJointDirection( direction, jointIndexopt ) → {Vec3}
Returns: The direction in the joint's coordinate system, or avatar coordinate system if no joint is specified. |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Transforms a direction in world coordinates to a direction in a joint's coordinates, or avatar coordinates if no joint is specified. Parameters
|
(static) worldToJointPoint( position, jointIndexopt ) → {Vec3}
Returns: The position in the joint's coordinate system, or avatar coordinate system if no joint is specified. |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Transforms a position in world coordinates to a position in a joint's coordinates, or avatar coordinates if no joint is specified. Parameters
|
(static) worldToJointRotation( rotation, jointIndexopt ) → {Quat}
Returns: The rotation in the joint's coordinate system, or avatar coordinate system if no joint is specified. |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Transforms a rotation in world coordinates to a rotation in a joint's coordinates, or avatar coordinates if no joint is specified. Parameters
|
Signal Details
analogPlusSprintSpeedChanged(
speed
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when the sprint (run) speed set for the "AnalogPlus" control scheme changes. Parameters
|