Description
Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts • Server Entity Scripts • Assignment Client Scripts
TheEntities
API provides facilities to create and interact with entities. Entities are 2D or 3D objects
displayed in-world. Depending on their EntityHostType, they may persist in the domain as
"domain" entities, travel to different domains with a user as "avatar" entities, or be visible only to an individual user as
"local" entities (a.k.a. "overlays").
Note: For Interface, avatar, and client entity scripts, the entities available to scripts are those that Interface has displayed and so knows about. For assignment client scripts, the entities available are those that are "seen" by the EntityViewer. For entity server scripts, all entities are available.
Entity Types & Properties
For a list of the entity types that you can use, see Entity Types.
For the properties of the different entity types, see Entity Properties. Some properties are universal to all entity types, and some are specific to particular entity types.
Entity Methods
Some of the API's signals correspond to entity methods that are called, if present, in the entity being interacted with.
The client or server entity script must expose them as a property. However, unlike Entities.callEntityMethod, server
entity scripts do not need to list them in an remotelyCallable
property. The entity methods are called with
parameters per their corresponding signal.
Method Name | Corresponding Signal |
---|---|
clickDownOnEntity | Entities.clickDownOnEntity |
clickReleaseOnEntity | Entities.clickReleaseOnEntity |
collisionWithEntity | Entities.collisionWithEntity |
enterEntity | Entities.enterEntity |
holdingClickOnEntity | Entities.holdingClickOnEntity |
hoverEnterEntity | Entities.hoverEnterEntity |
hoverLeaveEntity | Entities.hoverLeaveEntity |
hoverOverEntity | Entities.hoverOverEntity |
leaveEntity | Entities.leaveEntity |
mouseDoublePressOnEntity | Entities.mouseDoublePressOnEntity |
mouseMoveOnEntity | Entities.mouseMoveOnEntity |
mouseMoveEvent | Deprecated: Use mouseMoveOnEntity
instead. |
mousePressOnEntity | Entities.mousePressOnEntity |
mouseReleaseOnEntity | Entities.mouseReleaseOnEntity |
See Entities.clickDownOnEntity for an example.
Properties
Name | Type | Summary |
---|---|---|
keyboardFocusEntity | Uuid |
The Web entity that has keyboard focus. If no
Web entity has keyboard focus, returns |
Methods
Name | Return Value | Summary |
---|---|---|
AABoxIntersectsCapsule
|
boolean |
Checks whether an axis-aligned box and a capsule intersect. |
addAction
|
Uuid |
Adds an action to an entity. An action is registered with the physics engine and is applied every physics simulation
step. Any entity may have more than one action associated with it, but only as many as will fit in an entity's
|
addEntity
|
Uuid |
Adds a new domain, avatar, or local entity. |
addEntity
|
Uuid |
Adds a new avatar entity ( |
appendPoint
|
boolean |
Appends a point to a Line entity. Deprecated: This function is deprecated and will be removed. Use PolyLine entities instead. |
callEntityClientMethod
|
None |
Calls a method in a specific user's client entity script from a server entity script. The entity script method must be
exposed as a property in the target client entity script. Additionally, the client entity script must
include the method's name in an exposed property called |
callEntityMethod
|
None |
Calls a method in a client entity script from an Interface, avatar, or client entity script, or calls a method in a
server entity script from a server entity script. The entity script method must be exposed as a property in the target
entity script. Additionally, if calling a server entity script, the server entity script must include the method's name
in an exposed property called |
callEntityServerMethod
|
None |
Calls a method in a server entity script from an Interface, avatar, or client entity script. The server entity script
method must be exposed as a property in the target server entity script. Additionally, the server entity script must
include the method's name in an exposed property called |
canAdjustLocks
|
boolean |
Checks whether or not the script can change the |
canGetAndSetPrivateUserData
|
boolean |
Checks whether or not the script can get and set the |
canReplaceContent
|
boolean |
Checks whether or not the script can replace the domain's content set. |
canRez
|
boolean |
Checks whether or not the script can rez (create) new entities in the domain. |
canRezAvatarEntities
|
boolean |
Checks whether or not the script can rez avatar entities. |
canRezCertified
|
boolean |
Checks whether or not the script can rez (create) new certified entities in the domain. Certified entities are entities that have PoP certificates. |
canRezTmp
|
boolean |
Checks whether or not the script can rez (create) new temporary entities in the domain. Temporary entities are entities
with a finite |
canRezTmpCertified
|
boolean |
Checks whether or not the script can rez (create) new temporary certified entities in the domain. Temporary entities are
entities with a finite |
canWriteAssets
|
boolean |
Checks whether or not the script can make changes to the asset server's assets. |
cloneEntity
|
Uuid |
Creates a clone of an entity. The clone has the same properties as the original except that: it has a modified
Domain entities must have their Avatar entities must have their |
deleteAction
|
boolean |
Deletes an action from an entity. |
deleteEntity
|
None |
Deletes an entity. |
dumpTree
|
None |
Dumps debug information about all entities in Interface's local in-memory tree of entities it knows about to the program log. |
editEntity
|
Uuid |
Edits an entity, changing one or more of its property values. |
emitScriptEvent
|
None |
Sends a message to a Web entity's HTML page. To receive the message, the web
page's script must connect to the
Use Entities.webEventReceived to receive messages from the Web entity's HTML page. Alternatively, you can use Entities.getEntityObject to exchange messages over a Web entity's HTML event bridge. |
findClosestEntity
|
Uuid |
Finds the domain or avatar entity with a position closest to a specified point and within a specified radius. |
findEntities
|
Array.<Uuid> |
Finds all domain and avatar entities that intersect a sphere. Note: Server entity scripts only find entities that have a server entity script running in them or a parent entity. You can apply a dummy script to entities that you want found in a search. |
findEntitiesByName
|
Array.<Uuid> |
Finds all domain and avatar entities with a particular name that intersect a sphere. Note: Server entity scripts only find entities that have a server entity script running in them or a parent entity. You can apply a dummy script to entities that you want found in a search. |
findEntitiesByType
|
Array.<Uuid> |
Finds all domain and avatar entities of a particular type that intersect a sphere. Note: Server entity scripts only find entities that have a server entity script running in them or a parent entity. You can apply a dummy script to entities that you want found in a search. |
findEntitiesInBox
|
Array.<Uuid> |
Finds all domain and avatar entities whose axis-aligned boxes intersect a search axis-aligned box. Note: Server entity scripts only find entities that have a server entity script running in them or a parent entity. You can apply a dummy script to entities that you want found in a search. |
findEntitiesInFrustum
|
Array.<Uuid> |
Finds all domain and avatar entities whose axis-aligned boxes intersect a search frustum. Note: Server entity scripts only find entities that have a server entity script running in them or a parent entity. You can apply a dummy script to entities that you want found in a search. |
findRayIntersection
|
Entities.RayToEntityIntersectionResult |
Finds the first avatar or domain entity intersected by a PickRay. |
getAbsoluteJointRotationInObjectFrame
|
Quat |
Gets the rotation of a joint in a Model entity relative to the entity's position and orientation. |
getAbsoluteJointTranslationInObjectFrame
|
Vec3 |
Gets the translation of a joint in a Model entity relative to the entity's position and orientation. |
getActionArguments
|
Entities.ActionArguments |
Gets the arguments of an action. |
getActionIDs
|
Array.<Uuid> |
Gets the IDs of the actions that are associated with an entity. |
getChildrenIDs
|
Array.<Uuid> |
Gets the IDs of entities and avatars that are directly parented to an entity or avatar model. To get all descendants, you can recurse on the IDs returned. |
getChildrenIDsOfJoint
|
Array.<Uuid> |
Gets the IDs of entities and avatars that are directly parented to an entity or avatar model's joint. To get all descendants, you can use getChildrenIDs to recurse on the IDs returned. |
getDrawZoneBoundaries
|
boolean |
Gets whether or not Zone entities' boundaries should be drawn. Currently not used. |
getEntityLocalTransform
|
Mat4 |
Gets the object to parent transform, excluding scale, of an entity. |
getEntityObject
|
object |
Gets an entity's script object. In particular, this is useful for accessing a Web
entity's HTML To send a message from an Interface script to a Web entity over its event bridge:
To receive a message from a Web entity over its event bridge in an Interface script:
Alternatively, you can use Entities.emitScriptEvent and Entities.webEventReceived to exchange messages with a Web entity over its event bridge. |
getEntityProperties
|
Entities.EntityProperties |
Gets an entity's property values. |
getEntityTransform
|
Mat4 |
Gets the object to world transform, excluding scale, of an entity. |
getEntityType
|
Entities.EntityType |
Gets an entity's type. |
getJointIndex
|
number |
Gets the index of a named joint in a Model entity. |
getJointNames
|
Array.<string> |
Gets the names of all the joints in a Model entity. |
getJointParent
|
number |
Gets the index of the parent joint of a joint in a Model entity. |
getKeyboardFocusEntity
|
Uuid |
Gets the ID of the Web entity that has keyboard focus. |
getLifetimeBPS
|
number |
Gets the entity bytes per second send rate of the client over its lifetime. |
getLifetimeBPSQueued
|
number |
Gets the entity bytes per second queued rate of the client over its lifetime. |
getLifetimeBytesQueued
|
number |
Gets the total bytes of entity packets queued by the client over its lifetime. |
getLifetimeBytesSent
|
number |
Gets the total bytes of entity packets sent by the client over its lifetime. |
getLifetimeInSeconds
|
number |
Gets the lifetime of the client from the first entity packet sent until now, in seconds. |
getLifetimeInUsecs
|
number |
Gets the lifetime of the client from the first entity packet sent until now, in microseconds. |
getLifetimePacketsQueued
|
number |
Gets the total number of entity packets queued by the client over its lifetime. |
getLifetimePacketsSent
|
number |
Gets the total number of entity packets sent by the client over its lifetime. |
getLifetimePPS
|
number |
Gets the entity packets per second send rate of the client over its lifetime. |
getLifetimePPSQueued
|
number |
Gets the entity packets per second queued rate of the client over its lifetime. |
getLightsArePickable
|
boolean |
Gets whether or not ray picks intersect the bounding box of Light entities. Ray picks are performed using findRayIntersection, or the Picks API. |
getLocalJointRotation
|
Quat |
Gets the local rotation of a joint in a Model entity. |
getLocalJointTranslation
|
Vec3 |
Gets the local translation of a joint in a Model entity. |
getMeshes
|
None |
Gets the meshes in a Model or PolyVox entity. Deprecated: This function is deprecated and will be removed. It no longer works for Model entities. Use the Graphics API instead. |
getMultipleEntityProperties
|
Array.<Entities.EntityProperties> |
Gets the properties of multiple entities. |
getNestableType
|
Entities.NestableType |
Gets the type — entity or avatar — of an in-world item. |
getPacketsPerSecond
|
number |
Gets the maximum number of entity packets that the client can send per second. |
getPropertyInfo
|
Entities.EntityPropertyInfo |
Gets information about an entity property, including a minimum to maximum range for some numerical properties. |
getServerScriptStatus
|
boolean |
Gets the status of a server entity script attached to an entity. |
getStaticCertificateJSON
|
string |
Gets the static certificate for an entity. The static certificate contains static properties of the item which cannot be altered. |
getZonesArePickable
|
boolean |
Gets whether or not ray picks intersect the bounding box of Zone entities. Ray picks are performed using findRayIntersection, or the Picks API. |
hasPacketsToSend
|
boolean |
Checks whether the client has entity packets waiting to be sent. |
isAddedEntity
|
boolean |
Checks if there is an entity with a specified ID. |
isChildOfParent
|
boolean |
Checks whether an entity has an entity as an ancestor (parent, parent's parent, etc.). |
isLoaded
|
boolean |
Checks whether an entity's assets have been loaded. For example, for an |
localCoordsToVoxelCoords
|
Vec3 |
Converts local coordinates to voxel coordinates in a PolyVox entity. Local
coordinates are relative to the minimum axes value corner of the entity, with the scale being the same as world
coordinates. Voxel coordinates are relative to the minimum axes values corner of the entity, with a scale of
|
localToWorldAngularVelocity
|
Vec3 |
Converts a Euler angular velocity in an avatar, entity, or joint's local coordinate to an angular velocity in world coordinates. |
localToWorldDimensions
|
Vec3 |
Converts dimensions in an avatar or entity's local coordinates to dimensions in world coordinates. |
localToWorldPosition
|
Vec3 |
Converts a position in an avatar, entity, or joint's local coordinate to a position in world coordinates. |
localToWorldRotation
|
Quat |
Converts a rotation or orientation in an avatar, entity, or joint's local coordinate to a rotation in world coordinates. |
localToWorldVelocity
|
Vec3 |
Converts a velocity in an avatar, entity, or joint's local coordinate to a velocity in world coordinates. |
packetsToSendCount
|
number |
Gets the number of entity packets the client has waiting to be sent. |
queryPropertyMetadata
|
boolean |
Gets metadata for certain entity properties such as |
queryPropertyMetadata
|
boolean |
Gets metadata for certain entity properties such as |
reloadServerScripts
|
boolean |
Reloads an entity's server entity script such that the latest version re-downloaded. |
sendClickDownOnEntity
|
None |
Emits a clickDownOnEntity event. |
sendClickReleaseOnEntity
|
None |
Emits a clickReleaseOnEntity event. |
sendHoldingClickOnEntity
|
None |
Emits a holdingClickOnEntity event. |
sendHoverEnterEntity
|
None |
Emits a hoverEnterEntity event. |
sendHoverLeaveEntity
|
None |
Emits a hoverLeaveEntity event. |
sendHoverOverEntity
|
None |
Emits a hoverOverEntity event. |
sendMouseMoveOnEntity
|
None |
Emits a mouseMoveOnEntity event. |
sendMousePressOnEntity
|
None |
Emits a mousePressOnEntity event. |
sendMouseReleaseOnEntity
|
None |
Emits a mouseReleaseOnEntity event. |
serversExist
|
boolean |
Checks whether servers exist for the client to send entity packets to, i.e., whether you are connected to a domain and its entity server is working. |
setAbsoluteJointRotationInObjectFrame
|
boolean |
Sets the rotation of a joint in a Model entity relative to the entity's position and orientation. |
setAbsoluteJointTranslationInObjectFrame
|
boolean |
Sets the translation of a joint in a Model entity relative to the entity's position and orientation. |
setAllPoints
|
boolean |
Sets all the points in a Line entity. Deprecated: This function is deprecated and will be removed. Use PolyLine entities instead. |
setAllVoxels
|
None |
Sets the values of all voxels in a PolyVox entity. |
setDrawZoneBoundaries
|
None |
Sets whether or not Zone entities' boundaries should be drawn. Currently not used. |
setKeyboardFocusEntity
|
None |
Sets the Web entity that has keyboard focus. |
setLightsArePickable
|
None |
Sets whether or not ray picks intersect the bounding box of Light entities. By default, Light entities are not intersected. The setting lasts for the Interface session. Ray picks are performed using findRayIntersection, or the Picks API. |
setLocalJointRotation
|
boolean |
Sets the local rotation of a joint in a Model entity. |
setLocalJointRotations
|
boolean |
Sets the local rotations of joints in a Model entity. |
setLocalJointsData
|
boolean |
Sets the local rotations and translations of joints in a Model entity. This is the same as calling both setLocalJointRotations and setLocalJointTranslations at the same time. |
setLocalJointTranslation
|
boolean |
Sets the local translation of a joint in a Model entity. |
setLocalJointTranslations
|
boolean |
Sets the local translations of joints in a Model entity. |
setPacketsPerSecond
|
None |
Sets the maximum number of entity packets that the client can send per second. |
setVoxel
|
None |
Sets the value of a particular voxel in a PolyVox entity. |
setVoxelCapsule
|
None |
Sets the values of all voxels in a capsule-shaped portion of a PolyVox entity. |
setVoxelsInCuboid
|
None |
Sets the values of all voxels in a cubic portion of a PolyVox entity. |
setVoxelSphere
|
None |
Sets the values of all voxels in a spherical portion of a PolyVox entity. |
setZonesArePickable
|
None |
Sets whether or not ray picks intersect the bounding box of Zone entities. By default, Zone entities are not intersected. The setting lasts for the Interface session. Ray picks are performed using findRayIntersection, or the Picks API. |
textSize
|
Size |
Calculates the size of some text in a Text entity. The entity need not be set visible. Note: The size of text in a Text entity cannot be calculated immediately after the entity is created; a short delay is required while the entity finishes being created. |
updateAction
|
boolean |
Updates an entity action. |
verifyStaticCertificateProperties
|
boolean |
Verifies the entity's proof of provenance, i.e., that the entity's |
voxelCoordsToLocalCoords
|
Vec3 |
Converts voxel coordinates in a PolyVox entity to local coordinates. Local
coordinates are relative to the minimum axes value corner of the entity, with the scale being the same as world
coordinates. Voxel coordinates are relative to the minimum axes values corner of the entity, with a scale of
|
voxelCoordsToWorldCoords
|
Vec3 |
Converts voxel coordinates in a PolyVox entity to world coordinates. Voxel
coordinates are relative to the minimum axes values corner of the entity with a scale of |
wantsHandControllerPointerEvents
|
boolean |
Checks whether an entity wants hand controller pointer events. For example, a Web entity does but a Shape entity doesn't. |
worldCoordsToVoxelCoords
|
Vec3 |
Converts world coordinates to voxel coordinates in a PolyVox entity. Voxel
coordinates are relative to the minimum axes values corner of the entity, with a scale of |
worldToLocalAngularVelocity
|
Vec3 |
Converts a Euler angular velocity in world coordinates to an angular velocity in an avatar, entity, or joint's local coordinates. |
worldToLocalDimensions
|
Vec3 |
Converts dimensions in world coordinates to dimensions in an avatar or entity's local coordinates. |
worldToLocalPosition
|
Vec3 |
Converts a position in world coordinates to a position in an avatar, entity, or joint's local coordinates. |
worldToLocalRotation
|
Quat |
Converts a rotation or orientation in world coordinates to rotation in an avatar, entity, or joint's local coordinates. |
worldToLocalVelocity
|
Vec3 |
Converts a velocity in world coordinates to a velocity in an avatar, entity, or joint's local coordinates. |
Signals
Name | Summary |
---|---|
addingEntity
|
Triggered when an entity is added to Interface's local in-memory tree of entities it knows about. This may occur when entities are loaded upon visiting a domain, when the user rotates their view so that more entities become visible, and when any type of entity is created (e.g., by addEntity). |
addingWearable
|
Triggered when a "wearable" entity is added to Interface's local in-memory tree of entities it knows about, for example when adding a "wearable" to your avatar. |
canAdjustLocksChanged
|
Triggered when your ability to change the |
canGetAndSetPrivateUserDataChanged
|
Triggered when your ability to get and set private user data changes. |
canRezAvatarEntitiesChanged
|
Triggered when your ability to use avatar entities is changed. |
canRezCertifiedChanged
|
Triggered when your ability to rez (create) certified entities changes. Certified entities are entities that have PoP certificates. |
canRezChanged
|
Triggered when your ability to rez (create) entities changes. |
canRezTmpCertifiedChanged
|
Triggered when your ability to rez (create) temporary certified entities changes. Temporary entities are entities with a
finite |
canRezTmpChanged
|
Triggered when your ability to rez (create) temporary entities changes. Temporary entities are entities with a finite
|
canWriteAssetsChanged
|
Triggered when your ability to make changes to the asset server's assets changes. |
clearingEntities
|
Triggered when you disconnect from a domain, at which time Interface's local in-memory tree of entities that it knows about is cleared. |
clickDownOnEntity
|
Triggered when a mouse button is clicked while the mouse cursor is on an entity. Note: Not triggered by controllers. See also, Entity Methods and Script.addEventHandler. |
clickReleaseOnEntity
|
Triggered when a mouse button is released after clicking on an entity, even if the mouse cursor has moved off the entity. Note: Not triggered by controllers. See also, Entity Methods and Script.addEventHandler. |
collisionWithEntity
|
Triggered on the client that is the physics simulation owner during the collision of two entities. Note: Isn't triggered for a collision with an avatar. See also, Entity Methods and Script.addEventHandler. |
deletingEntity
|
Triggered when an entity is deleted. |
deletingWearable
|
Triggered when a "wearable" entity is deleted, for example when removing a "wearable" from your avatar. |
enterEntity
|
Triggered when an avatar enters an entity. Note: At the initial loading of the script, if the avatar is already present inside the entity, it might be too late to catch this event when the script runs, so it won't trigger. The preload signal can be used to handle those cases. See also, Entity Methods and Script.addEventHandler. |
holdingClickOnEntity
|
Repeatedly triggered while a mouse button continues to be held after clicking an entity, even if the mouse cursor has moved off the entity. Note: Not triggered by controllers. See also, Entity Methods and Script.addEventHandler. |
hoverEnterEntity
|
Triggered when the mouse cursor or controller laser starts hovering on an entity. See also, Entity Methods and Script.addEventHandler. |
hoverLeaveEntity
|
Triggered when the mouse cursor or controller laser stops hovering over an entity. See also, Entity Methods and Script.addEventHandler. |
hoverOverEntity
|
Repeatedly triggered when the mouse cursor or controller laser moves while hovering over an entity. See also, Entity Methods and Script.addEventHandler. |
leaveEntity
|
Triggered when an avatar leaves an entity. See also, Entity Methods and Script.addEventHandler. |
mouseDoublePressOffEntity
|
Triggered when a mouse button is double-clicked while the mouse cursor is not on an entity. |
mouseDoublePressOnEntity
|
Triggered when a mouse button is double-clicked while the mouse cursor is on an entity. |
mouseMoveOnEntity
|
Repeatedly triggered while the mouse cursor or controller laser moves on an entity. See also, Entity Methods and Script.addEventHandler. |
mousePressOffEntity
|
Triggered when a mouse button is clicked while the mouse cursor is not on an entity. |
mousePressOnEntity
|
Triggered when a mouse button is clicked while the mouse cursor is on an entity, or a controller trigger is fully pressed while its laser is on an entity. See also, Entity Methods and Script.addEventHandler. |
mouseReleaseOnEntity
|
Triggered when a mouse button is released after clicking on an entity or the controller trigger is partly or fully released after pressing on an entity, even if the mouse pointer or controller laser has moved off the entity. See also, Entity Methods and Script.addEventHandler. |
preload
|
Triggered when the script starts for a user. See also, Script.entityScriptPreloadFinished. Note: Can only be connected to via Supported Script Types: Client Entity Scripts • Server Entity Scripts |
unload
|
Triggered when the script terminates for a user. Note: Can only be connected to via Supported Script Types: Client Entity Scripts • Server Entity Scripts |
webEventReceived
|
Triggered when a script in a Web entity's HTML sends an event over the entity's HTML event bridge. The HTML web page can send a message by calling:
Use Entities.emitScriptEvent to send messages to the Web entity's HTML page. Alternatively, you can use Entities.getEntityObject to exchange messages over a Web entity's HTML event bridge. |
Type Definitions
ActionArguments Type: object |
||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Different entity action types have different arguments: some common to all actions (listed in the table) and some specific to each ActionType (linked to below). Properties
See: |
ActionArguments-BallSocket Type: object |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
|
ActionArguments-ConeTwist Type: object |
|||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
|
ActionArguments-FarGrab Type: object |
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
|
ActionArguments-Hinge Type: object |
|||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
|
ActionArguments-Hold Type: object |
|||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
|
ActionArguments-Offset Type: object |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
|
ActionArguments-Slider Type: object |
||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
|
ActionArguments-Tractor Type: object |
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
|
ActionArguments-TravelOriented Type: object |
|||||||||
---|---|---|---|---|---|---|---|---|---|
The Properties
|
ActionType Type: string |
||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
An entity action may be one of the following types:
|
AmbientLight Type: object |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Ambient light is defined by the following properties: Properties
|
AnimationProperties Type: object |
||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
An animation is configured by the following properties: Properties
|
AvatarPriorityMode Type: string |
||||||||
---|---|---|---|---|---|---|---|---|
The priority of updates from avatars in a zone to other clients.
|
Bloom Type: object |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Bloom is defined by the following properties: Properties
|
BoundingBox Type: object |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The axis-aligned bounding box of an entity. Properties
|
ComponentMode Type: string |
||||||||
---|---|---|---|---|---|---|---|---|
How an effect is applied in a Zone entity.
|
EntityHostType Type: string |
||||||||
---|---|---|---|---|---|---|---|---|
How an entity is hosted and sent to others for display.
|
EntityProperties Type: object |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Different entity types have different properties: some common to all entities (listed in the table) and some specific to each EntityType (linked to below). Properties
See:
|
EntityProperties-Box Type: object |
---|
The See: |
EntityProperties-Gizmo Type: object |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
|
EntityProperties-Grid Type: object |
||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
Example
|
EntityProperties-Image Type: object |
|||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
Example
|
EntityProperties-Light Type: object |
||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
Example
|
EntityProperties-Line Type: object |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
The Deprecated: Use PolyLine entities instead. Properties
Example
|
EntityProperties-Material Type: object |
|||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The To apply a material to an entity, set the material entity's Properties
Example
|
EntityProperties-Model Type: object |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
Example
|
EntityProperties-ParticleEffect Type: object |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
Example
|
EntityProperties-PolyLine Type: object |
|||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
Example
|
EntityProperties-PolyVox Type: object |
||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The PolyVox entities uses a library from Volumes of Fun. Their library documentation may be useful to read. Properties
Example
|
EntityProperties-Shape Type: object |
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
Example
|
EntityProperties-Sphere Type: object |
---|
The See: |
EntityProperties-Text Type: object |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
Example
|
EntityProperties-Web Type: object |
|||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
Example
|
EntityProperties-Zone Type: object |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The Properties
Example
|
EntityPropertyInfo Type: object |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Information about an entity property. Properties
|
EntityType Type: string |
|||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
An entity may be one of the following types:
|
GizmoType Type: string |
||||
---|---|---|---|---|
A Gizmo entity may be one of the following types:
|
Grab Type: object |
||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Grabbing behavior is defined by the following properties: Properties
|
Haze Type: object |
|||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Haze is defined by the following properties: Properties
|
KeyLight Type: object |
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A key light is defined by the following properties: Properties
|
Material Type: object |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A material used in a MaterialResource. Properties
|
MaterialResource Type: object |
|||||||||
---|---|---|---|---|---|---|---|---|---|
A material or set of materials used by a Material entity. Properties
|
NestableType Type: string |
||||||||
---|---|---|---|---|---|---|---|---|
An in-world item may be one of the following types:
|
PhysicsMotionType Type: string |
||||||||
---|---|---|---|---|---|---|---|---|
An entity's physics motion type may be one of the following:
|
PolyVoxSurfaceStyle Type: number |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The surface of a PolyVox entity may be one of the following styles:
|
PrimitiveMode Type: string |
||||||
---|---|---|---|---|---|---|
How the geometry of an entity is rendered.
|
Pulse Type: object |
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A color and alpha pulse that an entity may have. Properties
|
PulseMode Type: string |
||||||||
---|---|---|---|---|---|---|---|---|
Pulse modes for color and alpha pulsing.
|
RayToEntityIntersectionResult Type: object |
|||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The result of a findRayIntersection search using a PickRay. Properties
|
RenderInfo Type: object |
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Information on how an entity is rendered. Properties are only filled in for Properties
|
RenderLayer Type: string |
||||||||
---|---|---|---|---|---|---|---|---|
A layer in which an entity may be rendered.
|
RingGizmo Type: object |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A ring Gizmo entity is defined by the following properties: Properties
|
Shape Type: string |
|||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A
|
Skybox Type: object |
|||||||||
---|---|---|---|---|---|---|---|---|---|
A skybox is defined by the following properties: Properties
|
TextAlignment Type: string |
||||||||
---|---|---|---|---|---|---|---|---|
A Text entity may use one of the following alignments:
|
TextEffect Type: string |
||||||||||
---|---|---|---|---|---|---|---|---|---|---|
A Text entity may use one of the following effects:
|
getMeshesCallback( meshes, success )
Type: function |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Called when a Entities.getMeshes call is complete. Deprecated: This function is deprecated and will be removed. It no longer works for Model entities. Use the Graphics API instead. Parameters
|
getServerScriptStatusCallback( success, isRunning, status, errorInfo )
Type: function |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Called when a Entities.getServerScriptStatus call is complete. Parameters
|
queryPropertyMetadataCallback( error, result )
Type: function |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Called when a Entities.queryPropertyMetadata call is complete. Parameters
|
Method Details
(static) AABoxIntersectsCapsule( brn, dimensions, start, end, radius ) → {boolean}
Returns: true if the AA box and capsule intersect, otherwise false .
|
||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Checks whether an axis-aligned box and a capsule intersect. Parameters
|
(static) addAction( actionType, entityID, arguments ) → {Uuid}
Returns: The ID of the action if successfully added, otherwise null .
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Adds an action to an entity. An action is registered with the physics engine and is applied every physics simulation
step. Any entity may have more than one action associated with it, but only as many as will fit in an entity's
Parameters
Example
|
(static) addEntity( properties, entityHostTypeopt ) → {Uuid}
Returns: The ID of the entity if successfully created, otherwise Uuid.NULL. |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Adds a new domain, avatar, or local entity. Parameters
Example
|
(static) addEntity( properties, avatarEntityopt ) → {Uuid}
Returns: The ID of the entity if successfully created, otherwise Uuid.NULL. |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Adds a new avatar entity ( Parameters
|
(static) appendPoint( entityID, point ) → {boolean}
Returns: true if the point was added to the line, otherwise false . The point may
fail to be added if the entity does not exist, the entity is not a Line
entity, the point is outside the entity's dimensions, or the maximum number of points has been reached.
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Appends a point to a Line entity. Deprecated: This function is deprecated and will be removed. Use PolyLine entities instead. Parameters
Example
|
(static) callEntityClientMethod( clientSessionID, entityID, method, parametersopt ) | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Calls a method in a specific user's client entity script from a server entity script. The entity script method must be
exposed as a property in the target client entity script. Additionally, the client entity script must
include the method's name in an exposed property called Parameters
Example
|
(static) callEntityMethod( entityID, method, parametersopt ) | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Calls a method in a client entity script from an Interface, avatar, or client entity script, or calls a method in a
server entity script from a server entity script. The entity script method must be exposed as a property in the target
entity script. Additionally, if calling a server entity script, the server entity script must include the method's name
in an exposed property called Parameters
Example
|
(static) callEntityServerMethod( entityID, method, parametersopt ) | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Calls a method in a server entity script from an Interface, avatar, or client entity script. The server entity script
method must be exposed as a property in the target server entity script. Additionally, the server entity script must
include the method's name in an exposed property called Parameters
Example
|
(static) canAdjustLocks( ) → {boolean}
Returns: true if the domain server will allow the script to change the locked
property of entities, otherwise false .
|
---|
Checks whether or not the script can change the Example
|
(static) canGetAndSetPrivateUserData( ) → {boolean}
Returns: true if the domain server will allow the script to get and set the
privateUserData property of entities, otherwise false .
|
---|
Checks whether or not the script can get and set the |
(static) canReplaceContent( ) → {boolean}
Returns: true if the domain server will allow the script to replace the domain's content set,
otherwise false .
|
---|
Checks whether or not the script can replace the domain's content set. |
(static) canRez( ) → {boolean}
Returns: true if the domain server will allow the script to rez (create) new entities, otherwise
false .
|
---|
Checks whether or not the script can rez (create) new entities in the domain. |
(static) canRezAvatarEntities( ) → {boolean}
Returns: true if the domain server will allow the script to rez avatar entities,
otherwise false .
|
---|
Checks whether or not the script can rez avatar entities. |
(static) canRezCertified( ) → {boolean}
Returns: true if the domain server will allow the script to rez (create) new certified entities,
otherwise false .
|
---|
Checks whether or not the script can rez (create) new certified entities in the domain. Certified entities are entities that have PoP certificates. |
(static) canRezTmp( ) → {boolean}
Returns: true if the domain server will allow the script to rez (create) new temporary entities,
otherwise false .
|
---|
Checks whether or not the script can rez (create) new temporary entities in the domain. Temporary entities are entities
with a finite |
(static) canRezTmpCertified( ) → {boolean}
Returns: true if the domain server will allow the script to rez (create) new temporary certified
entities, otherwise false .
|
---|
Checks whether or not the script can rez (create) new temporary certified entities in the domain. Temporary entities are
entities with a finite |
(static) canWriteAssets( ) → {boolean}
Returns: true if the domain server will allow the script to make changes to the asset server's
assets, otherwise false .
|
---|
Checks whether or not the script can make changes to the asset server's assets. |
(static) cloneEntity( entityID ) → {Uuid}
Returns: The ID of the new entity if successfully cloned, otherwise Uuid.NULL. |
||||||
---|---|---|---|---|---|---|
Creates a clone of an entity. The clone has the same properties as the original except that: it has a modified
Domain entities must have their Avatar entities must have their Parameters
|
(static) deleteAction( entityID, actionID ) → {boolean}
Returns: true if the delete was successful, otherwise false .
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Deletes an action from an entity. Parameters
|
(static) deleteEntity( entityID ) | ||||||
---|---|---|---|---|---|---|
Deletes an entity. Parameters
Example
|
(static) dumpTree( ) |
---|
Dumps debug information about all entities in Interface's local in-memory tree of entities it knows about to the program log. |
(static) editEntity( entityID, properties ) → {Uuid}
Returns: The ID of the entity if the edit was successful, otherwise null or Uuid.NULL.
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Edits an entity, changing one or more of its property values. Parameters
Example
|
(static) emitScriptEvent( entityID, message ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sends a message to a Web entity's HTML page. To receive the message, the web
page's script must connect to the
Use Entities.webEventReceived to receive messages from the Web entity's HTML page. Alternatively, you can use Entities.getEntityObject to exchange messages over a Web entity's HTML event bridge. Parameters
Example
|
(static) findClosestEntity( center, radius ) → {Uuid}
Returns: The ID of the entity that is closest to the center and within the radius , if
there is one, otherwise null .
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Finds the domain or avatar entity with a position closest to a specified point and within a specified radius. Parameters
Example
|
(static) findEntities( center, radius ) → {Array.<Uuid>}
Returns: An array of entity IDs that intersect the search sphere. The array is empty if no entities could be found. |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Finds all domain and avatar entities that intersect a sphere. Note: Server entity scripts only find entities that have a server entity script running in them or a parent entity. You can apply a dummy script to entities that you want found in a search. Parameters
Example
|
(static) findEntitiesByName( entityName, center, radius, caseSensitiveopt ) → {Array.<Uuid>}
Returns: An array of entity IDs that have the specified name and intersect the search sphere. The array is empty if no entities could be found. |
|||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Finds all domain and avatar entities with a particular name that intersect a sphere. Note: Server entity scripts only find entities that have a server entity script running in them or a parent entity. You can apply a dummy script to entities that you want found in a search. Parameters
Example
|
(static) findEntitiesByType( entityType, center, radius ) → {Array.<Uuid>}
Returns: An array of entity IDs of the specified type that intersect the search sphere. The array is empty if no entities could be found. |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Finds all domain and avatar entities of a particular type that intersect a sphere. Note: Server entity scripts only find entities that have a server entity script running in them or a parent entity. You can apply a dummy script to entities that you want found in a search. Parameters
Example
|
(static) findEntitiesInBox( corner, dimensions ) → {Array.<Uuid>}
Returns: An array of entity IDs whose AA boxes intersect the search AA box. The array is empty if no entities could be found. |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Finds all domain and avatar entities whose axis-aligned boxes intersect a search axis-aligned box. Note: Server entity scripts only find entities that have a server entity script running in them or a parent entity. You can apply a dummy script to entities that you want found in a search. Parameters
|
(static) findEntitiesInFrustum( frustum ) → {Array.<Uuid>}
Returns: An array of entity IDs whose axis-aligned boxes intersect the search frustum. The array is empty if no entities could be found. |
||||||
---|---|---|---|---|---|---|
Finds all domain and avatar entities whose axis-aligned boxes intersect a search frustum. Note: Server entity scripts only find entities that have a server entity script running in them or a parent entity. You can apply a dummy script to entities that you want found in a search. Parameters
Example
|
(static) findRayIntersection( pickRay, precisionPickingopt, entitiesToIncludeopt, entitiesToDiscardopt, visibleOnlyopt, collideableOnlyopt ) → {Entities.RayToEntityIntersectionResult}
Returns: The result of the search for the first intersected entity. |
|||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Finds the first avatar or domain entity intersected by a PickRay. Parameters
Example
|
(static) getAbsoluteJointRotationInObjectFrame( entityID, jointIndex ) → {Quat}
Returns: The rotation of the joint relative to the entity's orientation if the entity is a Model entity, the entity is loaded, and the joint index is valid; otherwise Quat.IDENTITY .
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Gets the rotation of a joint in a Model entity relative to the entity's position and orientation. Parameters
Example
|
(static) getAbsoluteJointTranslationInObjectFrame( entityID, jointIndex ) → {Vec3}
Returns: The translation of the joint relative to the entity's position and orientation if the entity is a Model entity, the entity is loaded, and the joint index is valid; otherwise Vec3.ZERO .
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Gets the translation of a joint in a Model entity relative to the entity's position and orientation. Parameters
|
(static) getActionArguments( entityID, actionID ) → {Entities.ActionArguments}
Returns: The arguments of the action if found, otherwise an empty object. |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Gets the arguments of an action. Parameters
|
(static) getActionIDs( entityID ) → {Array.<Uuid>}
Returns: The action IDs if any are found, otherwise an empty array. |
||||||
---|---|---|---|---|---|---|
Gets the IDs of the actions that are associated with an entity. Parameters
|
(static) getChildrenIDs( parentID ) → {Array.<Uuid>}
Returns: An array of entity and avatar IDs that are parented directly to the parentID
entity or avatar. Does not include children's children, etc. The array is empty if no children can be found or
parentID cannot be found.
|
||||||
---|---|---|---|---|---|---|
Gets the IDs of entities and avatars that are directly parented to an entity or avatar model. To get all descendants, you can recurse on the IDs returned. Parameters
Example
|
(static) getChildrenIDsOfJoint( parentID, jointIndex ) → {Array.<Uuid>}
Returns: An array of entity and avatar IDs that are parented directly to the parentID
entity or avatar at the jointIndex joint. Does not include children's children, etc. The
array is empty if no children can be found or parentID cannot be found.
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Gets the IDs of entities and avatars that are directly parented to an entity or avatar model's joint. To get all descendants, you can use getChildrenIDs to recurse on the IDs returned. Parameters
Example
|
(static) getDrawZoneBoundaries( ) → {boolean}
Returns: true if Zone entities' boundaries should be
drawn, otherwise false .
|
---|
Gets whether or not Zone entities' boundaries should be drawn. Currently not used. |
(static) getEntityLocalTransform( entityID ) → {Mat4}
Returns: The entity's object to parent transform excluding scale (i.e., translation and rotation, with scale of 1) if the entity can be found, otherwise a transform with zero translation and rotation and a scale of 1. If the entity doesn't have a parent, its world transform is returned. |
||||||
---|---|---|---|---|---|---|
Gets the object to parent transform, excluding scale, of an entity. Parameters
Example
|
(static) getEntityObject( id ) → {object}
Returns: The script object for the entity if found. |
||||||
---|---|---|---|---|---|---|
Gets an entity's script object. In particular, this is useful for accessing a Web
entity's HTML To send a message from an Interface script to a Web entity over its event bridge:
To receive a message from a Web entity over its event bridge in an Interface script:
Alternatively, you can use Entities.emitScriptEvent and Entities.webEventReceived to exchange messages with a Web entity over its event bridge. Parameters
Example
|
(static) getEntityProperties( entityID, desiredPropertiesopt ) → {Entities.EntityProperties}
Returns: The specified properties of the entity if the entity can be found, otherwise an empty object. If no properties are specified, then all properties are returned. |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Gets an entity's property values. Parameters
Example
|
(static) getEntityTransform( entityID ) → {Mat4}
Returns: The entity's object to world transform excluding scale (i.e., translation and rotation, with scale of 1) if the entity can be found, otherwise a transform with zero translation and rotation and a scale of 1. |
||||||
---|---|---|---|---|---|---|
Gets the object to world transform, excluding scale, of an entity. Parameters
Example
|
(static) getEntityType( id ) → {Entities.EntityType}
Returns: The type of the entity. |
||||||
---|---|---|---|---|---|---|
Gets an entity's type. Parameters
|
(static) getJointIndex( entityID, name ) → {number}
Returns: The integer index of the joint if the entity is a Model entity, the entity is loaded, and the joint is present; otherwise -1 . The joint indexes are in order
per getJointNames.
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Gets the index of a named joint in a Model entity. Parameters
Example
|
(static) getJointNames( entityID ) → {Array.<string>}
Returns: The names of all the joints in the entity if it is a Model entity and is loaded, otherwise an empty array. The joint names are in order per getJointIndex. |
||||||
---|---|---|---|---|---|---|
Gets the names of all the joints in a Model entity. Parameters
Example
|
(static) getJointParent( entityID, index ) → {number}
Returns: The index of the parent joint if found, otherwise -1 .
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Gets the index of the parent joint of a joint in a Model entity. Parameters
|
(static) getKeyboardFocusEntity( ) → {Uuid}
Returns: The ID of the Web entity that has focus, if any, otherwise null .
|
---|
Gets the ID of the Web entity that has keyboard focus. |
(static) getLifetimeBPS( ) → {number}
Returns: Entity bytes per second send rate of the client over its lifetime. |
---|
Gets the entity bytes per second send rate of the client over its lifetime. |
(static) getLifetimeBPSQueued( ) → {number}
Returns: Entity bytes per second queued rate of the client over its lifetime. |
---|
Gets the entity bytes per second queued rate of the client over its lifetime. |
(static) getLifetimeBytesQueued( ) → {number}
Returns: The total bytes of entity packets queued by the client over its lifetime. |
---|
Gets the total bytes of entity packets queued by the client over its lifetime. |
(static) getLifetimeBytesSent( ) → {number}
Returns: The total bytes of entity packets sent by the client over its lifetime. |
---|
Gets the total bytes of entity packets sent by the client over its lifetime. |
(static) getLifetimeInSeconds( ) → {number}
Returns: Lifetime of the client from the first entity packet sent until now, in seconds. |
---|
Gets the lifetime of the client from the first entity packet sent until now, in seconds. |
(static) getLifetimeInUsecs( ) → {number}
Returns: Lifetime of the client from the first entity packet sent until now, in microseconds. |
---|
Gets the lifetime of the client from the first entity packet sent until now, in microseconds. |
(static) getLifetimePacketsQueued( ) → {number}
Returns: The total number of entity packets queued by the client over its lifetime. |
---|
Gets the total number of entity packets queued by the client over its lifetime. |
(static) getLifetimePacketsSent( ) → {number}
Returns: The total number of entity packets sent by the client over its lifetime. |
---|
Gets the total number of entity packets sent by the client over its lifetime. |
(static) getLifetimePPS( ) → {number}
Returns: Entity packets per second send rate of the client over its lifetime. |
---|
Gets the entity packets per second send rate of the client over its lifetime. |
(static) getLifetimePPSQueued( ) → {number}
Returns: Entity packets per second queued rate of the client over its lifetime. |
---|
Gets the entity packets per second queued rate of the client over its lifetime. |
(static) getLightsArePickable( ) → {boolean}
Returns: true if ray picks intersect the bounding box of
Light entities, otherwise false .
|
---|
Gets whether or not ray picks intersect the bounding box of Light entities. Ray picks are performed using findRayIntersection, or the Picks API. |
(static) getLocalJointRotation( entityID, jointIndex ) → {Quat}
Returns: The local rotation of the joint if the entity is a Model entity, the entity is loaded, and the joint index is valid; otherwise Quat.IDENTITY .
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Gets the local rotation of a joint in a Model entity. Parameters
Example
|
(static) getLocalJointTranslation( entityID, jointIndex ) → {Vec3}
Returns: The local translation of the joint if the entity is a Model entity, the entity is loaded, and the joint index is valid; otherwise Vec3.ZERO .
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Gets the local translation of a joint in a Model entity. Parameters
|
(static) getMeshes( entityID, callback ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Gets the meshes in a Model or PolyVox entity. Deprecated: This function is deprecated and will be removed. It no longer works for Model entities. Use the Graphics API instead. Parameters
|
(static) getMultipleEntityProperties( entityIDs, desiredPropertiesopt ) → {Array.<Entities.EntityProperties>}
Returns: The specified properties of each entity for each entity that can be found. If none of the entities can be found, then an empty array is returned. If no properties are specified, then all properties are returned. |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Gets the properties of multiple entities. Parameters
Example
|
(static) getNestableType( id ) → {Entities.NestableType}
Returns: The type of the item. |
||||||
---|---|---|---|---|---|---|
Gets the type — entity or avatar — of an in-world item. Parameters
Example
|
(static) getPacketsPerSecond( ) → {number}
Returns: Integer maximum number of entity packets that the client can send per second. |
---|
Gets the maximum number of entity packets that the client can send per second. |
(static) getPropertyInfo( propertyName ) → {Entities.EntityPropertyInfo}
Returns: The information about the property if it can be found, otherwise an empty object. |
||||||
---|---|---|---|---|---|---|
Gets information about an entity property, including a minimum to maximum range for some numerical properties. Parameters
Example
|
(static) getServerScriptStatus( entityID, callback ) → {boolean}
Returns: true always.
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Gets the status of a server entity script attached to an entity. Parameters
|
(static) getStaticCertificateJSON( entityID ) → {string}
Returns: The entity's static certificate as a JSON string if the entity can be found, otherwise "" .
|
||||||
---|---|---|---|---|---|---|
Gets the static certificate for an entity. The static certificate contains static properties of the item which cannot be altered. Parameters
|
(static) getZonesArePickable( ) → {boolean}
Returns: true if ray picks intersect the bounding box of
Zone entities, otherwise false .
|
---|
Gets whether or not ray picks intersect the bounding box of Zone entities. Ray picks are performed using findRayIntersection, or the Picks API. |
(static) hasPacketsToSend( ) → {boolean}
Returns: true if the client has entity packets waiting to be sent, otherwise false .
|
---|
Checks whether the client has entity packets waiting to be sent. |
(static) isAddedEntity( id ) → {boolean}
Returns: true if an entity with the specified ID exists, false if it doesn't.
|
||||||
---|---|---|---|---|---|---|
Checks if there is an entity with a specified ID. Parameters
|
(static) isChildOfParent( childID, parentID ) → {boolean}
Returns: true if the childID entity has the parentID entity
as a parent or grandparent etc., otherwise false .
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Checks whether an entity has an entity as an ancestor (parent, parent's parent, etc.). Parameters
Example
|
(static) isLoaded( id ) → {boolean}
Returns: true if the entity's assets have been loaded, otherwise false .
|
||||||
---|---|---|---|---|---|---|
Checks whether an entity's assets have been loaded. For example, for an Parameters
|
(static) localCoordsToVoxelCoords( entityID, localCoords ) → {Vec3}
Returns: The voxel coordinates of the worldCoords if the entityID is a
PolyVox entity, otherwise Vec3.ZERO. The value may be
fractional and outside the entity's bounding box.
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Converts local coordinates to voxel coordinates in a PolyVox entity. Local
coordinates are relative to the minimum axes value corner of the entity, with the scale being the same as world
coordinates. Voxel coordinates are relative to the minimum axes values corner of the entity, with a scale of
Parameters
|
(static) localToWorldAngularVelocity( localAngularVelocity, parentID, parentJointIndexopt, scalesWithParentopt ) → {Vec3}
Returns: The angular velocity converted to world coordinates if successful, otherwise Vec3.ZERO. |
|||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Converts a Euler angular velocity in an avatar, entity, or joint's local coordinate to an angular velocity in world coordinates. Parameters
|
(static) localToWorldDimensions( localDimensions, parentID, parentJointIndexopt, scalesWithParentopt ) → {Vec3}
Returns: The dimensions converted to world coordinates if successful, otherwise Vec3.ZERO. |
|||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Converts dimensions in an avatar or entity's local coordinates to dimensions in world coordinates. Parameters
|
(static) localToWorldPosition( localPosition, parentID, parentJointIndexopt, scalesWithparentopt ) → {Vec3}
Returns: The position converted to world coordinates if successful, otherwise Vec3.ZERO. |
|||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Converts a position in an avatar, entity, or joint's local coordinate to a position in world coordinates. Parameters
|
(static) localToWorldRotation( localRotation, parentID, parentJointIndexopt, scalesWithParentopt ) → {Quat}
Returns: The rotation converted to local coordinates if successful, otherwise Quat.IDENTITY. |
|||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Converts a rotation or orientation in an avatar, entity, or joint's local coordinate to a rotation in world coordinates. Parameters
|
(static) localToWorldVelocity( localVelocity, parentID, parentJointIndexopt, scalesWithParentopt ) → {Vec3}
Returns: The velocity converted to world coordinates it successful, otherwise Vec3.ZERO. |
|||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Converts a velocity in an avatar, entity, or joint's local coordinate to a velocity in world coordinates. Parameters
|
(static) packetsToSendCount( ) → {number}
Returns: Integer number of entity packets the client has waiting to be sent. |
---|
Gets the number of entity packets the client has waiting to be sent. |
(static) queryPropertyMetadata( entityID, property, callback ) → {boolean}
Returns: true if the request for metadata was successfully sent to the server, otherwise
false .
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Gets metadata for certain entity properties such as Throws
Throws an error if
property is not handled yet or callback is not a function.
Parameters
|
(static) queryPropertyMetadata( entityID, property, scope, callback ) → {boolean}
Returns: true if the request for metadata was successfully sent to the server, otherwise
false .
|
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Gets metadata for certain entity properties such as Throws
Throws an error if
property is not handled yet or callback is not a function.
Parameters
|
(static) reloadServerScripts( entityID ) → {boolean}
Returns: true if the reload request was successfully sent to the server, otherwise
false .
|
||||||
---|---|---|---|---|---|---|
Reloads an entity's server entity script such that the latest version re-downloaded. Parameters
|
(static) sendClickDownOnEntity( entityID, event ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Emits a clickDownOnEntity event. Parameters
|
(static) sendClickReleaseOnEntity( entityID, event ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Emits a clickReleaseOnEntity event. Parameters
|
(static) sendHoldingClickOnEntity( entityID, event ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Emits a holdingClickOnEntity event. Parameters
|
(static) sendHoverEnterEntity( entityID, event ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Emits a hoverEnterEntity event. Parameters
|
(static) sendHoverLeaveEntity( entityID, event ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Emits a hoverLeaveEntity event. Parameters
|
(static) sendHoverOverEntity( entityID, event ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Emits a hoverOverEntity event. Parameters
|
(static) sendMouseMoveOnEntity( entityID, event ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Emits a mouseMoveOnEntity event. Parameters
|
(static) sendMousePressOnEntity( entityID, event ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Emits a mousePressOnEntity event. Parameters
|
(static) sendMouseReleaseOnEntity( entityID, event ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Emits a mouseReleaseOnEntity event. Parameters
|
(static) serversExist( ) → {boolean}
Returns: true if servers exist for the client to send entity packets to, otherwise
false .
|
---|
Checks whether servers exist for the client to send entity packets to, i.e., whether you are connected to a domain and its entity server is working. |
(static) setAbsoluteJointRotationInObjectFrame( entityID, jointIndex, rotation ) → {boolean}
Returns: true if the entity is a Model entity, the entity
is loaded, the joint index is valid, and the rotation is different to the joint's current rotation; otherwise
false .
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets the rotation of a joint in a Model entity relative to the entity's position and orientation. Parameters
Example
|
(static) setAbsoluteJointTranslationInObjectFrame( entityID, jointIndex, translation ) → {boolean}
Returns: true if the entity is a Model entity, the entity
is loaded, the joint index is valid, and the translation is different to the joint's current translation; otherwise
false .
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets the translation of a joint in a Model entity relative to the entity's position and orientation. Parameters
|
(static) setAllPoints( entityID, points ) → {boolean}
Returns: true if the entity was updated, otherwise false . The property may fail to
be updated if the entity does not exist, the entity is not a Line entity,
one of the points is outside the entity's dimensions, or the number of points is greater than the maximum allowed.
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Sets all the points in a Line entity. Deprecated: This function is deprecated and will be removed. Use PolyLine entities instead. Parameters
Example
|
(static) setAllVoxels( entityID, value ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets the values of all voxels in a PolyVox entity. Parameters
Example
|
(static) setDrawZoneBoundaries( value ) | ||||||
---|---|---|---|---|---|---|
Sets whether or not Zone entities' boundaries should be drawn. Currently not used. Parameters
|
(static) setKeyboardFocusEntity( id ) | ||||||
---|---|---|---|---|---|---|
Sets the Web entity that has keyboard focus. Parameters
|
(static) setLightsArePickable( value ) | ||||||
---|---|---|---|---|---|---|
Sets whether or not ray picks intersect the bounding box of Light entities. By default, Light entities are not intersected. The setting lasts for the Interface session. Ray picks are performed using findRayIntersection, or the Picks API. Parameters
|
(static) setLocalJointRotation( entityID, jointIndex, rotation ) → {boolean}
Returns: true if the entity is a Model entity, the entity
is loaded, the joint index is valid, and the rotation is different to the joint's current rotation; otherwise
false .
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets the local rotation of a joint in a Model entity. Parameters
Example
|
(static) setLocalJointRotations( entityID, rotations ) → {boolean}
Returns: true if the entity is a Model entity, the entity
is loaded, the model has joints, and at least one of the rotations is different to the model's current rotations;
otherwise false .
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Sets the local rotations of joints in a Model entity. Parameters
Example
|
(static) setLocalJointsData( entityID, rotations, translations ) → {boolean}
Returns: true if the entity is a Model entity, the entity
is loaded, the model has joints, and at least one of the rotations or translations is different to the model's
current values; otherwise false .
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets the local rotations and translations of joints in a Model entity. This is the same as calling both setLocalJointRotations and setLocalJointTranslations at the same time. Parameters
|
(static) setLocalJointTranslation( entityID, jointIndex, translation ) → {boolean}
Returns: true if the entity is a Model entity, the entity
is loaded, the joint index is valid, and the translation is different to the joint's current translation; otherwise
false .
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets the local translation of a joint in a Model entity. Parameters
|
(static) setLocalJointTranslations( entityID, translations ) → {boolean}
Returns: true if the entity is a Model entity, the entity
is loaded, the model has joints, and at least one of the translations is different to the model's current
translations; otherwise false .
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Sets the local translations of joints in a Model entity. Parameters
|
(static) setPacketsPerSecond( packetsPerSecond ) | ||||||
---|---|---|---|---|---|---|
Sets the maximum number of entity packets that the client can send per second. Parameters
|
(static) setVoxel( entityID, position, value ) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets the value of a particular voxel in a PolyVox entity. Parameters
Example
|
(static) setVoxelCapsule( entityID, start, end, radius, value ) | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets the values of all voxels in a capsule-shaped portion of a PolyVox entity. Parameters
Example
|
(static) setVoxelsInCuboid( entityID, lowPosition, cuboidSize, value ) | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets the values of all voxels in a cubic portion of a PolyVox entity. Parameters
Example
|
(static) setVoxelSphere( entityID, center, radius, value ) | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Sets the values of all voxels in a spherical portion of a PolyVox entity. Parameters
Example
|
(static) setZonesArePickable( value ) | ||||||
---|---|---|---|---|---|---|
Sets whether or not ray picks intersect the bounding box of Zone entities. By default, Zone entities are not intersected. The setting lasts for the Interface session. Ray picks are performed using findRayIntersection, or the Picks API. Parameters
|
(static) textSize( id, text ) → {Size}
Returns: The size of the text in meters if the object is a text entity, otherwise
{ height: 0, width : 0 } .
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Calculates the size of some text in a Text entity. The entity need not be set visible. Note: The size of text in a Text entity cannot be calculated immediately after the entity is created; a short delay is required while the entity finishes being created. Parameters
|
(static) updateAction( entityID, actionID, arguments ) → {boolean}
Returns: true if the update was successful, otherwise false .
|
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Updates an entity action. Parameters
|
(static) verifyStaticCertificateProperties( entityID ) → {boolean}
Returns: true if the entity can be found, its certificateID property is present, and
its value matches the entity's static certificate JSON; otherwise false .
|
||||||
---|---|---|---|---|---|---|
Verifies the entity's proof of provenance, i.e., that the entity's Parameters
|
(static) voxelCoordsToLocalCoords( entityID, voxelCoords ) → {Vec3}
Returns: The local coordinates of the voxelCoords if the entityID is a
PolyVox entity, otherwise Vec3.ZERO.
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Converts voxel coordinates in a PolyVox entity to local coordinates. Local
coordinates are relative to the minimum axes value corner of the entity, with the scale being the same as world
coordinates. Voxel coordinates are relative to the minimum axes values corner of the entity, with a scale of
Parameters
Example
|
(static) voxelCoordsToWorldCoords( entityID, voxelCoords ) → {Vec3}
Returns: The world coordinates of the voxelCoords if the entityID is a
PolyVox entity, otherwise Vec3.ZERO.
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Converts voxel coordinates in a PolyVox entity to world coordinates. Voxel
coordinates are relative to the minimum axes values corner of the entity with a scale of Parameters
Example
|
(static) wantsHandControllerPointerEvents( entityID ) → {boolean}
Returns: true if the entity can be found and it wants hand controller pointer events, otherwise
false .
|
||||||
---|---|---|---|---|---|---|
Checks whether an entity wants hand controller pointer events. For example, a Web entity does but a Shape entity doesn't. Parameters
|
(static) worldCoordsToVoxelCoords( entityID, worldCoords ) → {Vec3}
Returns: The voxel coordinates of the worldCoords if the entityID is a
PolyVox entity, otherwise Vec3.ZERO. The value may be
fractional and outside the entity's bounding box.
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Converts world coordinates to voxel coordinates in a PolyVox entity. Voxel
coordinates are relative to the minimum axes values corner of the entity, with a scale of Parameters
|
(static) worldToLocalAngularVelocity( worldAngularVelocity, parentID, parentJointIndexopt, scalesWithParentopt ) → {Vec3}
Returns: The angular velocity converted to local coordinates if successful, otherwise Vec3.ZERO. |
|||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Converts a Euler angular velocity in world coordinates to an angular velocity in an avatar, entity, or joint's local coordinates. Parameters
|
(static) worldToLocalDimensions( worldDimensions, parentID, parentJointIndexopt, scalesWithParentopt ) → {Vec3}
Returns: The dimensions converted to local coordinates if successful, otherwise Vec3.ZERO. |
|||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Converts dimensions in world coordinates to dimensions in an avatar or entity's local coordinates. Parameters
|
(static) worldToLocalPosition( worldPosition, parentID, parentJointIndexopt, scalesWithParentopt ) → {Vec3}
Returns: The position converted to local coordinates if successful, otherwise Vec3.ZERO. |
|||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Converts a position in world coordinates to a position in an avatar, entity, or joint's local coordinates. Parameters
Example
|
(static) worldToLocalRotation( worldRotation, parentID, parentJointIndexopt, scalesWithParentopt ) → {Quat}
Returns: The rotation converted to local coordinates if successful, otherwise Quat.IDENTITY. |
|||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Converts a rotation or orientation in world coordinates to rotation in an avatar, entity, or joint's local coordinates. Parameters
|
(static) worldToLocalVelocity( worldVelocity, parentID, parentJointIndexopt, scalesWithParentopt ) → {Vec3}
Returns: The velocity converted to local coordinates if successful, otherwise Vec3.ZERO. |
|||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Converts a velocity in world coordinates to a velocity in an avatar, entity, or joint's local coordinates. Parameters
|
Signal Details
addingEntity(
entityID
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when an entity is added to Interface's local in-memory tree of entities it knows about. This may occur when entities are loaded upon visiting a domain, when the user rotates their view so that more entities become visible, and when any type of entity is created (e.g., by addEntity). Parameters
Example
|
addingWearable(
entityID
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when a "wearable" entity is added to Interface's local in-memory tree of entities it knows about, for example when adding a "wearable" to your avatar. Parameters
Example
|
canAdjustLocksChanged(
canAdjustLocks
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when your ability to change the Parameters
Example
|
canGetAndSetPrivateUserDataChanged(
canGetAndSetPrivateUserData
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when your ability to get and set private user data changes. Parameters
|
canRezAvatarEntitiesChanged(
canRezAvatarEntities
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when your ability to use avatar entities is changed. Parameters
|
canRezCertifiedChanged(
canRezCertified
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when your ability to rez (create) certified entities changes. Certified entities are entities that have PoP certificates. Parameters
|
canRezChanged(
canRez
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when your ability to rez (create) entities changes. Parameters
|
canRezTmpCertifiedChanged(
canRezTmpCertified
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when your ability to rez (create) temporary certified entities changes. Temporary entities are entities with a
finite Parameters
|
canRezTmpChanged(
canRezTmp
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when your ability to rez (create) temporary entities changes. Temporary entities are entities with a finite
Parameters
|
canWriteAssetsChanged(
canWriteAssets
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when your ability to make changes to the asset server's assets changes. Parameters
|
clearingEntities(
)
Returns: Signal |
---|
Triggered when you disconnect from a domain, at which time Interface's local in-memory tree of entities that it knows about is cleared. Example
|
clickDownOnEntity(
entityID,
event
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Triggered when a mouse button is clicked while the mouse cursor is on an entity. Note: Not triggered by controllers. See also, Entity Methods and Script.addEventHandler. Parameters
Example
|
clickReleaseOnEntity(
entityID,
event
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Triggered when a mouse button is released after clicking on an entity, even if the mouse cursor has moved off the entity. Note: Not triggered by controllers. See also, Entity Methods and Script.addEventHandler. Parameters
|
collisionWithEntity(
idA,
idB,
collision
)
Returns: Signal |
||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Triggered on the client that is the physics simulation owner during the collision of two entities. Note: Isn't triggered for a collision with an avatar. See also, Entity Methods and Script.addEventHandler. Parameters
Example
|
deletingEntity(
entityID
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when an entity is deleted. Parameters
Example
|
deletingWearable(
entityID
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when a "wearable" entity is deleted, for example when removing a "wearable" from your avatar. Parameters
Example
|
enterEntity(
entityID
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when an avatar enters an entity. Note: At the initial loading of the script, if the avatar is already present inside the entity, it might be too late to catch this event when the script runs, so it won't trigger. The preload signal can be used to handle those cases. See also, Entity Methods and Script.addEventHandler. Parameters
|
holdingClickOnEntity(
entityID,
event
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Repeatedly triggered while a mouse button continues to be held after clicking an entity, even if the mouse cursor has moved off the entity. Note: Not triggered by controllers. See also, Entity Methods and Script.addEventHandler. Parameters
|
hoverEnterEntity(
entityID,
event
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Triggered when the mouse cursor or controller laser starts hovering on an entity. See also, Entity Methods and Script.addEventHandler. Parameters
|
hoverLeaveEntity(
entityID,
event
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Triggered when the mouse cursor or controller laser stops hovering over an entity. See also, Entity Methods and Script.addEventHandler. Parameters
|
hoverOverEntity(
entityID,
event
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Repeatedly triggered when the mouse cursor or controller laser moves while hovering over an entity. See also, Entity Methods and Script.addEventHandler. Parameters
|
leaveEntity(
entityID
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when an avatar leaves an entity. See also, Entity Methods and Script.addEventHandler. Parameters
|
mouseDoublePressOffEntity(
event
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when a mouse button is double-clicked while the mouse cursor is not on an entity. Parameters
|
mouseDoublePressOnEntity(
entityID,
event
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Triggered when a mouse button is double-clicked while the mouse cursor is on an entity. Parameters
|
mouseMoveOnEntity(
entityID,
event
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Repeatedly triggered while the mouse cursor or controller laser moves on an entity. See also, Entity Methods and Script.addEventHandler. Parameters
|
mousePressOffEntity(
event
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when a mouse button is clicked while the mouse cursor is not on an entity. Parameters
|
mousePressOnEntity(
entityID,
event
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Triggered when a mouse button is clicked while the mouse cursor is on an entity, or a controller trigger is fully pressed while its laser is on an entity. See also, Entity Methods and Script.addEventHandler. Parameters
Example
|
mouseReleaseOnEntity(
entityID,
event
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Triggered when a mouse button is released after clicking on an entity or the controller trigger is partly or fully released after pressing on an entity, even if the mouse pointer or controller laser has moved off the entity. See also, Entity Methods and Script.addEventHandler. Parameters
|
preload(
entityID
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when the script starts for a user. See also, Script.entityScriptPreloadFinished. Note: Can only be connected to via Supported Script Types: Client Entity Scripts • Server Entity Scripts Parameters
Example
|
unload(
entityID
)
Returns: Signal |
||||||
---|---|---|---|---|---|---|
Triggered when the script terminates for a user. Note: Can only be connected to via Supported Script Types: Client Entity Scripts • Server Entity Scripts Parameters
|
webEventReceived(
entityID,
message
)
Returns: Signal |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Triggered when a script in a Web entity's HTML sends an event over the entity's HTML event bridge. The HTML web page can send a message by calling:
Use Entities.emitScriptEvent to send messages to the Web entity's HTML page. Alternatively, you can use Entities.getEntityObject to exchange messages over a Web entity's HTML event bridge. Parameters
|