Description
Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts
ThePointers
API lets you create, manage, and visually represent objects for repeatedly calculating
intersections with avatars, entities, and overlays. Pointers can also be configured to generate events on entities and
overlays intersected.Methods
Name | Return Value | Summary |
---|---|---|
createPointer
|
number |
Creates a new ray, parabola, or stylus pointer. The pointer can have a wide range of behaviors depending on the properties specified. For example, a ray pointer may be a static ray pointer, a mouse ray pointer, or joint ray pointer. Warning: Pointers created using this method currently always intersect at least visible and collidable things but this may not always be the case. |
disablePointer
|
None |
Disables and hides a pointer. Disabled pointers do not update their pick results or generate events. |
editRenderState
|
None |
Edits a render state of a ray or parabola pointer, to change its visual appearance for the state when the pointer is intersecting something. Note: You can only edit the properties of the existing parts of the pointer; you cannot change the type of any part. Note: You cannot use this method to change the appearance of a default render state. Note: Not able to be used with stylus pointers. |
enablePointer
|
None |
Enables and shows a pointer. Enabled pointers update their pick results and generate events. |
getPointerProperties
|
Pointers.RayPointerProperties | Pointers.ParabolaPointerProperties | object |
Gets information about a pointer. |
getPointers
|
Array.<number> |
Gets all pointers which currently exist, including disabled pointers. |
getPointerScriptParameters
|
Pointers.RayPointerProperties | Pointers.ParabolaPointerProperties | Pointers.StylusPointerProperties |
Gets the parameters that were passed in to Pointers.createPointer to create the pointer when the pointer was created through a script. Note: These properties do not reflect the current state of the pointer. To get the current state of the pointer, see Pointers.getPointerProperties. |
getPrevPickResult
|
RayPickResult | ParabolaPickResult | StylusPickResult |
Gets the most recent intersection of a pointer. A pointer continues to be updated ready to return a result, as long as it is enabled, regardless of the render state. |
isLeftHand
|
boolean |
Checks if a pointer is associated with the left hand: a ray or parabola pointer with |
isMouse
|
boolean |
Checks if a pointer is associated with the system mouse: a ray or parabola pointer with |
isPointerEnabled
|
boolean |
Gets the enabled status of a pointer. Enabled pointers update their pick results and generate events. |
isRightHand
|
boolean |
Checks if a pointer is associated with the right hand: a ray or parabola pointer with |
removePointer
|
None |
Removes (deletes) a pointer. |
setIgnoreItems
|
None |
Sets a list of entity and avatar IDs that a pointer should ignore during intersection. Note: Not used by stylus pointers. |
setIncludeItems
|
None |
Sets a list of entity and avatar IDs that a pointer should include during intersection, instead of intersecting with everything. Note: Stylus pointers only intersect with items in their include list. |
setLength
|
None |
Sets the length of a pointer. Note: Not used by stylus pointers. |
setLockEndUUID
|
None |
Locks a pointer onto a specific entity or avatar. Note: Not used by stylus pointers. |
setPrecisionPicking
|
None |
Sets whether or not a pointer should use precision picking, i.e., whether it should pick against precise meshes or
coarse meshes. This has the same effect as using the |
setRenderState
|
None |
Sets the render state of a pointer, to change its visual appearance and possibly disable or enable it. |
Type Definitions
DefaultParabolaPointerRenderState Type: object |
||||||
---|---|---|---|---|---|---|
Properties that define the visual appearance of a parabola pointer when the pointer is not intersecting something. These are properties of Pointers.ParabolaPointerRenderState but with an additional property. Properties
See:
|
DefaultRayPointerRenderState Type: object |
||||||
---|---|---|---|---|---|---|
Properties that define the visual appearance of a ray pointer when the pointer is not intersecting something. These are the properties of Pointers.RayPointerRenderState but with an additional property. Properties
See:
|
ParabolaPointerPath Type: object |
||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The visual appearance of the parabolic path. Properties
|
ParabolaPointerProperties Type: object |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The properties of a parabola pointer. These include the properties from the underlying parabola pick that the pointer uses. Properties
See:
|
ParabolaPointerRenderState Type: object |
||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Properties that define the visual appearance of a parabola pointer when the pointer is intersecting something. Properties
|
RayPointerProperties Type: object |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The properties of a ray pointer. These include the properties from the underlying ray pick that the pointer uses. Properties
See:
|
RayPointerRenderState Type: object |
||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Properties that define the visual appearance of a ray pointer when the pointer is intersecting something. Properties
|
StylusPointerModel Type: object |
||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The properties of a stylus pointer model. Properties
|
StylusPointerProperties Type: object |
||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
The properties of a stylus pointer. These include the properties from the underlying stylus pick that the pointer uses. Properties
See:
|
Trigger Type: object |
|||||||||
---|---|---|---|---|---|---|---|---|---|
Specifies that a Controller action or function should trigger events on the entity or overlay currently intersected by a Ray or Parabola pointer. Properties
|
Method Details
(static) createPointer( type, properties ) → {number}
Returns: The ID of the pointer if successfully created, otherwise 0 .
|
|||||||||
---|---|---|---|---|---|---|---|---|---|
Creates a new ray, parabola, or stylus pointer. The pointer can have a wide range of behaviors depending on the properties specified. For example, a ray pointer may be a static ray pointer, a mouse ray pointer, or joint ray pointer. Warning: Pointers created using this method currently always intersect at least visible and collidable things but this may not always be the case. Parameters
Example
|
(static) disablePointer( id ) | ||||||
---|---|---|---|---|---|---|
Disables and hides a pointer. Disabled pointers do not update their pick results or generate events. Parameters
|
(static) editRenderState( id, renderState, properties ) | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Edits a render state of a ray or parabola pointer, to change its visual appearance for the state when the pointer is intersecting something. Note: You can only edit the properties of the existing parts of the pointer; you cannot change the type of any part. Note: You cannot use this method to change the appearance of a default render state. Note: Not able to be used with stylus pointers. Parameters
Example
|
(static) enablePointer( id ) | ||||||
---|---|---|---|---|---|---|
Enables and shows a pointer. Enabled pointers update their pick results and generate events. Parameters
|
(static) getPointerProperties( id ) → {Pointers.RayPointerProperties|Pointers.ParabolaPointerProperties|object}
Returns: The renderStates and
defaultRenderStates for ray and parabola pointers, {} for stylus pointers.
|
||||||
---|---|---|---|---|---|---|
Gets information about a pointer. Parameters
Example
|
(static) getPointers( ) → {Array.<number>}
Returns: pointers - The IDs of the pointers. |
---|
Gets all pointers which currently exist, including disabled pointers. |
(static) getPointerScriptParameters( id ) → {Pointers.RayPointerProperties|Pointers.ParabolaPointerProperties|Pointers.StylusPointerProperties}
Returns: Script-provided properties, per the pointer type .
|
||||||
---|---|---|---|---|---|---|
Gets the parameters that were passed in to Pointers.createPointer to create the pointer when the pointer was created through a script. Note: These properties do not reflect the current state of the pointer. To get the current state of the pointer, see Pointers.getPointerProperties. Parameters
|
(static) getPrevPickResult( id ) → {RayPickResult|ParabolaPickResult|StylusPickResult}
Returns: The most recent intersection of the pointer. |
||||||
---|---|---|---|---|---|---|
Gets the most recent intersection of a pointer. A pointer continues to be updated ready to return a result, as long as it is enabled, regardless of the render state. Parameters
|
(static) isLeftHand( id ) → {boolean}
Returns: true if the pointer is associated with the left hand, false if it isn't.
|
||||||
---|---|---|---|---|---|---|
Checks if a pointer is associated with the left hand: a ray or parabola pointer with Parameters
|
(static) isMouse( id ) → {boolean}
Returns: true if the pointer is associated with the system mouse, false if it isn't.
|
||||||
---|---|---|---|---|---|---|
Checks if a pointer is associated with the system mouse: a ray or parabola pointer with Parameters
|
(static) isPointerEnabled( id ) → {boolean}
Returns: enabled - Whether or not the pointer is enabled. |
||||||
---|---|---|---|---|---|---|
Gets the enabled status of a pointer. Enabled pointers update their pick results and generate events. Parameters
|
(static) isRightHand( id ) → {boolean}
Returns: true if the pointer is associated with the right hand, false if it isn't.
|
||||||
---|---|---|---|---|---|---|
Checks if a pointer is associated with the right hand: a ray or parabola pointer with Parameters
|
(static) removePointer( id ) | ||||||
---|---|---|---|---|---|---|
Removes (deletes) a pointer. Parameters
|
(static) setIgnoreItems( id, ignoreItems ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets a list of entity and avatar IDs that a pointer should ignore during intersection. Note: Not used by stylus pointers. Parameters
|
(static) setIncludeItems( id, includeItems ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets a list of entity and avatar IDs that a pointer should include during intersection, instead of intersecting with everything. Note: Stylus pointers only intersect with items in their include list. Parameters
|
(static) setLength( id, length ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets the length of a pointer. Note: Not used by stylus pointers. Parameters
|
(static) setLockEndUUID( id, targetID, isAvatar, offsetopt ) | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Locks a pointer onto a specific entity or avatar. Note: Not used by stylus pointers. Parameters
|
(static) setPrecisionPicking( id, precisionPicking ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets whether or not a pointer should use precision picking, i.e., whether it should pick against precise meshes or
coarse meshes. This has the same effect as using the Parameters
|
(static) setRenderState( id, renderState ) | |||||||||
---|---|---|---|---|---|---|---|---|---|
Sets the render state of a pointer, to change its visual appearance and possibly disable or enable it. Parameters
Example
|