Interface IXRRayProvider
An interface that represents a Transform-driven XR Ray.
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
public interface IXRRayProvider
Properties
rayEndPoint
The last endpoint of this ray, either its maximum distance or a collision point.
Declaration
Vector3 rayEndPoint { get; }
Property Value
Type | Description |
---|---|
Vector3 |
rayEndTransform
The Transform of the object this ray has collided with, if any.
Declaration
Transform rayEndTransform { get; }
Property Value
Type | Description |
---|---|
Transform |
Methods
GetOrCreateAttachTransform()
Ensures a Transform exists for the ray attach point and returns it.
Declaration
Transform GetOrCreateAttachTransform()
Returns
Type | Description |
---|---|
Transform | The Transform that is used as the attach point for Interactables. |
GetOrCreateRayOrigin()
Ensures a Transform exists for the ray origin and returns it.
Declaration
Transform GetOrCreateRayOrigin()
Returns
Type | Description |
---|---|
Transform | The Transform that is the starting position and direction of any ray casts. |
SetAttachTransform(Transform)
Assigns a Transform to be the attach point of this ray.
Declaration
void SetAttachTransform(Transform newAttach)
Parameters
Type | Name | Description |
---|---|---|
Transform | newAttach | The Transform that is used as the attach point for Interactables. |
SetRayOrigin(Transform)
Assigns a Transform to be the source of this ray.
Declaration
void SetRayOrigin(Transform newOrigin)
Parameters
Type | Name | Description |
---|---|---|
Transform | newOrigin | The Transform that is the starting position and direction of any ray casts. |