Method TryAddRaycast
TryAddRaycast(Vector2, float, out XRRaycast)
Adds a new persistent raycast. Persistent raycasts should be updated automatically until this provider is stopped or destroyed or the raycast is removed with RemoveRaycast(TrackableId).
Declaration
public virtual bool TryAddRaycast(Vector2 screenPoint, float estimatedDistance, out XRRaycast raycast)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | screenPoint | A position on the screen in normalized screen coordinates (0, 0)..(1, 1). |
float | estimatedDistance | The estimated distance to the raycast target. |
XRRaycast | raycast | The newly added raycast. All spatial data should be reported relative to the session origin. |
Returns
Type | Description |
---|---|
bool |
|
TryAddRaycast(Ray, float, out XRRaycast)
Adds a new persistent raycast. Persistent raycasts should be updated automatically until this provider is stopped or destroyed or the raycast is removed with RemoveRaycast(TrackableId).
Declaration
public virtual bool TryAddRaycast(Ray ray, float estimatedDistance, out XRRaycast raycast)
Parameters
Type | Name | Description |
---|---|---|
Ray | ray | A ray in session space defining the raycast. |
float | estimatedDistance | The estimated distance to the raycast target. |
XRRaycast | raycast | The newly added raycast. All spatial data should be reported relative to the session origin. |
Returns
Type | Description |
---|---|
bool |
|