Class XRRaycastSubsystem.Provider
An interface to be implemented by providers of this subsystem.
Namespace: UnityEngine.XR.ARSubsystems
Syntax
protected class Provider
Methods
Destroy()
Called when the subsystem is destroyed. Stop() will be called first if the subsystem is running.
Declaration
public virtual void Destroy()
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 |
---|---|---|
XRRaycastHit | 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. |
TrackableType | trackableTypeMask | The types to raycast against. |
Allocator | allocator | The allocator with which to allocate the returned |
Returns
Type | Description |
---|---|
NativeArray<XRRaycastHit> |
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 |
---|---|---|
XRRaycastHit | 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 |
TrackableType | trackableTypeMask | The types to raycast against. |
Allocator | allocator | The allocator with which to allocate the returned |
Returns
Type | Description |
---|---|
NativeArray<XRRaycastHit> |
Start()
Called when the subsystem is started. Will not be called again until Stop().
Declaration
public virtual void Start()
Stop()
Called when the subsystem is stopped. Will not be called before Start().
Declaration
public virtual void Stop()