AvatarManager

Description

The AvatarManager API has properties and methods which manage Avatars within the same domain.

Note: This API is also provided to Interface and client entity scripts as the synonym, AvatarList. For assignment client scripts, see the separate AvatarList API.

Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts

Methods

Name Return Value Summary
findParabolaIntersectionVector ParabolaToAvatarIntersectionResult
findRayIntersection RayToAvatarIntersectionResult
findRayIntersectionVector RayToAvatarIntersectionResult
getAvatar AvatarData
getAvatarDataRate number
getAvatarIdentifiers Array.<Uuid>
getAvatarSimulationRate number
getAvatarsInRange Array.<Uuid>
getAvatarSortCoefficient number
getAvatarUpdateRate number
getPalData Array.<object> Used in the PAL for getting PAL-related data about avatars nearby. Using this method is faster than iterating over each avatar and obtaining data about them in JavaScript, as that method locks and unlocks each avatar's data structure potentially hundreds of times per update tick.
isAvatarInRange boolean
processAvatarDataPacket None
processAvatarIdentityPacket None
processBulkAvatarTraits None
processKillAvatar None
sessionUUIDChanged None
setAvatarSortCoefficient None
updateAvatarRenderStatus None

Signals

Name Summary
avatarAddedEvent
avatarRemovedEvent
avatarSessionChangedEvent

Method Details

(static) findParabolaIntersectionVector( pick, avatarsToInclude, avatarsToDiscard ) → {ParabolaToAvatarIntersectionResult}
Returns: ParabolaToAvatarIntersectionResult

Parameters

Name Type Description
pick PickParabola
avatarsToInclude Array.<Uuid>
avatarsToDiscard Array.<Uuid>
(static) findRayIntersection( ray, avatarsToIncludeopt, avatarsToDiscardopt, pickAgainstMesh ) → {RayToAvatarIntersectionResult}
Returns: RayToAvatarIntersectionResult

Parameters

Name Type Attributes Default Value Description
ray PickRay
avatarsToInclude Array.<Uuid> <optional>
[]
avatarsToDiscard Array.<Uuid> <optional>
[]
pickAgainstMesh boolean
(static) findRayIntersectionVector( ray, avatarsToInclude, avatarsToDiscard, pickAgainstMesh ) → {RayToAvatarIntersectionResult}
Returns: RayToAvatarIntersectionResult

Parameters

Name Type Description
ray PickRay
avatarsToInclude Array.<Uuid>
avatarsToDiscard Array.<Uuid>
pickAgainstMesh boolean
(static) getAvatar( avatarID ) → {AvatarData}
Returns: AvatarData

Parameters

Name Type Description
avatarID Uuid
(static) getAvatarDataRate( sessionID, rateNameopt ) → {number}
Returns: number

Parameters

Name Type Attributes Default Value Description
sessionID Uuid
rateName string <optional>
""
(static) getAvatarIdentifiers( ) → {Array.<Uuid>}
Returns: Array.<Uuid>

(static) getAvatarSimulationRate( sessionID, rateNameopt ) → {number}
Returns: number

Parameters

Name Type Attributes Default Value Description
sessionID Uuid
rateName string <optional>
""
(static) getAvatarsInRange( position, range ) → {Array.<Uuid>}
Returns: Array.<Uuid>

Parameters

Name Type Description
position Vec3
range number
(static) getAvatarSortCoefficient( name ) → {number}
Returns: number

Parameters

Name Type Description
name string
(static) getAvatarUpdateRate( sessionID, rateNameopt ) → {number}
Returns: number

Parameters

Name Type Attributes Default Value Description
sessionID Uuid
rateName string <optional>
""
(static) getPalData( specificAvatarIdentifiersopt ) → {Array.<object>}
Returns: An array of objects, each object being the PAL data for an avatar.

Used in the PAL for getting PAL-related data about avatars nearby. Using this method is faster than iterating over each avatar and obtaining data about them in JavaScript, as that method locks and unlocks each avatar's data structure potentially hundreds of times per update tick.

Parameters

Name Type Attributes Default Value Description
specificAvatarIdentifiers Array.<string> <optional>
[] The list of IDs of the avatars you want the PAL data for. If an empty list, the PAL data for all nearby avatars is returned.
(static) isAvatarInRange( position, range ) → {boolean}
Returns: boolean

Parameters

Name Type Description
position string
range string
(static) processAvatarDataPacket( message, sendingNode )

Parameters

Name Type Description
message
sendingNode
(static) processAvatarIdentityPacket( message, sendingNode )

Parameters

Name Type Description
message
sendingNode
(static) processBulkAvatarTraits( message, sendingNode )

Parameters

Name Type Description
message
sendingNode
(static) processKillAvatar( message, sendingNode )

Parameters

Name Type Description
message
sendingNode
(static) sessionUUIDChanged( sessionUUID, oldSessionUUID )

Parameters

Name Type Description
sessionUUID Uuid
oldSessionUUID Uuid
(static) setAvatarSortCoefficient( name, value )

Parameters

Name Type Description
name string
value number
(static) updateAvatarRenderStatus( shouldRenderAvatars )

Parameters

Name Type Description
shouldRenderAvatars boolean

Signal Details

avatarAddedEvent( sessionUUID )
Returns: Signal

 

Parameters

Name Type Description
sessionUUID Uuid
avatarRemovedEvent( sessionUUID )
Returns: Signal

 

Parameters

Name Type Description
sessionUUID Uuid
avatarSessionChangedEvent( sessionUUID, oldSessionUUID )
Returns: Signal

 

Parameters

Name Type Description
sessionUUID Uuid
oldSessionUUID Uuid