RayPick

Description

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

The RayPick API is a subset of the Picks API, as used for ray picks.

Deprecated: This API is deprecated and will be removed. Use the Picks API instead.

Properties

Name Type Summary
PICK_ENTITIES FilterFlags

Include domain and avatar entities when intersecting. Read-only.

PICK_OVERLAYS FilterFlags

Include local entities when intersecting. Read-only.

PICK_AVATARS FilterFlags

Include avatars when intersecting. Read-only.

PICK_HUD FilterFlags

Include the HUD surface when intersecting in HMD mode. Read-only.

PICK_PRECISE FilterFlags

Pick against exact meshes. Read-only.

PICK_INCLUDE_INVISIBLE FilterFlags

Include invisible objects when intersecting. Read-only.

PICK_INCLUDE_NONCOLLIDABLE FilterFlags

Include non-collidable objects when intersecting. Read-only.

PICK_ALL_INTERSECTIONS FilterFlags

Return all intersections instead of just the closest. Read-only.

INTERSECTED_NONE IntersectionType

Intersected nothing with the given filter flags. Read-only.

INTERSECTED_ENTITY IntersectionType

Intersected an entity. Read-only.

INTERSECTED_LOCAL_ENTITY IntersectionType

Intersected a local entity. Read-only.

INTERSECTED_OVERLAY IntersectionType

Intersected an entity (3D Overlays no longer exist). Read-only.

INTERSECTED_AVATAR IntersectionType

Intersected an avatar. Read-only.

INTERSECTED_HUD IntersectionType

Intersected the HUD surface. Read-only.

Methods

Name Return Value Summary
createRayPick number

Creates a new ray pick.

Warning: Picks created using this method currently always intersect at least visible and collidable things but this may not always be the case.

disableRayPick None

Disables a ray pick.

enableRayPick None

Enables a ray pick.

getPrevRayPickResult RayPickResult

Gets the most recent pick result from a ray pick. A ray pick continues to be updated ready to return a result, as long as it is enabled.

INTERSECTED_AVATAR number

Deprecated: This function is deprecated and will be removed. Use the RayPick.INTERSECTED_AVATAR property instead.

INTERSECTED_ENTITY number

Deprecated: This function is deprecated and will be removed. Use the RayPick.INTERSECTED_ENTITY property instead.

INTERSECTED_HUD number

Deprecated: This function is deprecated and will be removed. Use the RayPick.INTERSECTED_HUD property instead.

INTERSECTED_NONE number

Deprecated: This function is deprecated and will be removed. Use the RayPick.INTERSECTED_NONE property instead.

INTERSECTED_OVERLAY number

Deprecated: This function is deprecated and will be removed. Use the RayPick.INTERSECTED_LOCAL_ENTITY property instead.

INTERSECTED_OVERLAY number

Deprecated: This function is deprecated and will be removed. Use the RayPick.INTERSECTED_OVERLAY property instead.

isLeftHand boolean

Checks if a pick is associated with the left hand: a ray or parabola pick with joint property set to "_CONTROLLER_LEFTHAND" or "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND", or a stylus pick with hand property set to 0.

isMouse boolean

Checks if a pick is associated with the system mouse: a ray or parabola pick with joint property set to "Mouse".

isRightHand boolean

Checks if a pick is associated with the right hand: a ray or parabola pick with joint property set to "_CONTROLLER_RIGHTHAND" or "_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND", or a stylus pick with hand property set to 1.

PICK_ALL_INTERSECTIONS number

Deprecated: This function is deprecated and will be removed. Use the RayPick.PICK_ALL_INTERSECTIONS property instead.

PICK_AVATARS number

Deprecated: This function is deprecated and will be removed. Use the RayPick.PICK_AVATARS property instead.

PICK_COARSE number

Deprecated: This function is deprecated and will be removed. Use the RayPick.PICK_COARSE property instead.

PICK_ENTITIES number

Deprecated: This function is deprecated and will be removed. Use the Raypick.PICK_ENTITIES property instead.

PICK_HUD number

Deprecated: This function is deprecated and will be removed. Use the RayPick.PICK_HUD property instead.

PICK_INCLUDE_INVISIBLE number

Deprecated: This function is deprecated and will be removed. Use the RayPick.PICK_INCLUDE_INVISIBLE property instead.

PICK_INCLUDE_NONCOLLIDABLE number

Deprecated: This function is deprecated and will be removed. Use the RayPick.PICK_INCLUDE_NONCOLLIDABLE property instead.

PICK_OVERLAYS number

Deprecated: This function is deprecated and will be removed. Use the RayPick.PICK_OVERLAYS property instead.

removeRayPick None

Removes (deletes) a ray pick.

setIgnoreItems None

Sets a list of entity and avatar IDs that a ray pick should ignore during intersection.

setIncludeItems None

Sets a list of entity and avatar IDs that a ray pick should include during intersection, instead of intersecting with everything.

setPrecisionPicking None

Sets whether or not a ray pick should use precision picking, i.e., whether it should pick against precise meshes or coarse meshes.

Method Details

(static) createRayPick( properties ) → {number}
Returns: The ID of the pick created. 0 if invalid.

Creates a new ray pick.

Warning: Picks created using this method currently always intersect at least visible and collidable things but this may not always be the case.

Parameters

Name Type Description
properties Picks.RayPickProperties

Properties of the pick.

(static) disableRayPick( id )

Disables a ray pick.

Parameters

Name Type Description
id number

The ID of the ray pick.

(static) enableRayPick( id )

Enables a ray pick.

Parameters

Name Type Description
id number

The ID of the ray pick.

(static) getPrevRayPickResult( id ) → {RayPickResult}
Returns: RayPickResult

Gets the most recent pick result from a ray pick. A ray pick continues to be updated ready to return a result, as long as it is enabled.

Parameters

Name Type Description
id number

The ID of the ray pick.

(static) INTERSECTED_AVATAR( ) → {number}
Returns: number

Deprecated: This function is deprecated and will be removed. Use the RayPick.INTERSECTED_AVATAR property instead.

(static) INTERSECTED_ENTITY( ) → {number}
Returns: number

Deprecated: This function is deprecated and will be removed. Use the RayPick.INTERSECTED_ENTITY property instead.

(static) INTERSECTED_HUD( ) → {number}
Returns: number

Deprecated: This function is deprecated and will be removed. Use the RayPick.INTERSECTED_HUD property instead.

(static) INTERSECTED_NONE( ) → {number}
Returns: number

Deprecated: This function is deprecated and will be removed. Use the RayPick.INTERSECTED_NONE property instead.

(static) INTERSECTED_OVERLAY( ) → {number}
Returns: number

Deprecated: This function is deprecated and will be removed. Use the RayPick.INTERSECTED_LOCAL_ENTITY property instead.

(static) INTERSECTED_OVERLAY( ) → {number}
Returns: number

Deprecated: This function is deprecated and will be removed. Use the RayPick.INTERSECTED_OVERLAY property instead.

(static) isLeftHand( id ) → {boolean}
Returns: true if the pick is associated with the left hand, false if it isn't.

Checks if a pick is associated with the left hand: a ray or parabola pick with joint property set to "_CONTROLLER_LEFTHAND" or "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND", or a stylus pick with hand property set to 0.

Parameters

Name Type Description
id number

The ID of the ray pick.

(static) isMouse( id ) → {boolean}
Returns: true if the pick is associated with the system mouse, false if it isn't.

Checks if a pick is associated with the system mouse: a ray or parabola pick with joint property set to "Mouse".

Parameters

Name Type Description
id number

The ID of the ray pick.

(static) isRightHand( id ) → {boolean}
Returns: true if the pick is associated with the right hand, false if it isn't.

Checks if a pick is associated with the right hand: a ray or parabola pick with joint property set to "_CONTROLLER_RIGHTHAND" or "_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND", or a stylus pick with hand property set to 1.

Parameters

Name Type Description
id number

The ID of the ray pick.

(static) PICK_ALL_INTERSECTIONS( ) → {number}
Returns: number

Deprecated: This function is deprecated and will be removed. Use the RayPick.PICK_ALL_INTERSECTIONS property instead.

(static) PICK_AVATARS( ) → {number}
Returns: number

Deprecated: This function is deprecated and will be removed. Use the RayPick.PICK_AVATARS property instead.

(static) PICK_COARSE( ) → {number}
Returns: number

Deprecated: This function is deprecated and will be removed. Use the RayPick.PICK_COARSE property instead.

(static) PICK_ENTITIES( ) → {number}
Returns: number

Deprecated: This function is deprecated and will be removed. Use the Raypick.PICK_ENTITIES property instead.

(static) PICK_HUD( ) → {number}
Returns: number

Deprecated: This function is deprecated and will be removed. Use the RayPick.PICK_HUD property instead.

(static) PICK_INCLUDE_INVISIBLE( ) → {number}
Returns: number

Deprecated: This function is deprecated and will be removed. Use the RayPick.PICK_INCLUDE_INVISIBLE property instead.

(static) PICK_INCLUDE_NONCOLLIDABLE( ) → {number}
Returns: number

Deprecated: This function is deprecated and will be removed. Use the RayPick.PICK_INCLUDE_NONCOLLIDABLE property instead.

(static) PICK_OVERLAYS( ) → {number}
Returns: number

Deprecated: This function is deprecated and will be removed. Use the RayPick.PICK_OVERLAYS property instead.

(static) removeRayPick( id )

Removes (deletes) a ray pick.

Parameters

Name Type Description
id number

The ID of the ray pick.

(static) setIgnoreItems( id, ignoreItems )

Sets a list of entity and avatar IDs that a ray pick should ignore during intersection.

Parameters

Name Type Description
id number

The ID of the ray pick.

ignoreItems Array.<Uuid>

The list of IDs to ignore.

(static) setIncludeItems( id, includeItems )

Sets a list of entity and avatar IDs that a ray pick should include during intersection, instead of intersecting with everything.

Parameters

Name Type Description
id number

The ID of the ray pick.

includeItems Array.<Uuid>

The list of IDs to include.

(static) setPrecisionPicking( id, precisionPicking )

Sets whether or not a ray pick should use precision picking, i.e., whether it should pick against precise meshes or coarse meshes.

Parameters

Name Type Description
id number

The ID of the ray pick.

precisionPicking boolean

true to use precision picking, false to use coarse picking.