Method Raycast
Raycast(XRRaycastHit, Ray, TrackableType, Allocator)
Performs a raycast from an arbitrary ray against the types
specified by trackableTypeMask
. Results
should be sorted by distance from the ray origin.
Declaration
public virtual NativeArray<XRRaycastHit> Raycast(XRRaycastHit defaultRaycastHit, Ray ray, TrackableType trackableTypeMask, Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
XRRaycast |
defaultRaycastHit | The default raycast hit that should be used as a template when populating the returned |
Ray | ray | A ray in session space from which to raycast. |
Trackable |
trackableTypeMask | The types to raycast against. |
Allocator | allocator | The allocator with which to allocate the returned |
Returns
Type | Description |
---|---|
Native |
A |
Raycast(XRRaycastHit, Vector2, TrackableType, Allocator)
Performs a raycast from the camera against the types
specified by trackableTypeMask
. Results
should be sorted by distance from the ray origin.
Declaration
public virtual NativeArray<XRRaycastHit> Raycast(XRRaycastHit defaultRaycastHit, Vector2 screenPoint, TrackableType trackableTypeMask, Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
XRRaycast |
defaultRaycastHit | The default raycast hit that should be used as a template when populating the returned |
Vector2 | screenPoint | A point on the screen in normalized (0..1) coordinates. |
Trackable |
trackableTypeMask | The types to raycast against. |
Allocator | allocator | The allocator with which to allocate the returned |
Returns
Type | Description |
---|---|
Native |
A |