API reference
API reference
Select your platform
No SDKs available
No versions available

RayInteractor Class

Defines a raycast interaction suitable to use at both short and long ranges.
The origin and direction of the ray can be set by anything, but are typically associated with the motion of a Input.IController or Input.IHand. The interactable type for this interactor is RayInteractable.

Properties

The position, in world space, from which the interactor's raycast will begin.
This position is derived from the Transform provided as _rayOrigin, which can be set either in the UnityEditor or programmatically using InjectRayOrigin(Transform).
The rotation, in world space, of the interactor's raycast.
This rotation is derived from the Transform provided as _rayOrigin, which can be set either in the UnityEditor or programmatically using InjectRayOrigin(Transform).
The forward direction, in world space, of the interactor's raycast.
This is derived from the Transform provided as _rayOrigin, which can be set either in the UnityEditor or programmatically using InjectRayOrigin(Transform).
The end position, in world space, of the interactor's raycast.
This is discovered as part of the raycast process and will lie on the hit RayInteractable if one was hit, or at <see cref="Origin"/> + <see cref="Forward"/> * <see cref="MaxRayLength"/> if nothing was hit.
The maximum allowable length of the ray, in meters in world space.
RayInteractables intersected by the ray at points more distant from the Origin than this will be ignored.
If the most recent raycast hit a RayInteractable, information about that hit will be exposed here.
Otherwise, this property will be null.
The ray which is used when raycasting for interaction.
This is derived from Origin and Forward.

Fields

Implementation of Interactor<TInteractor, TInteractable>.CandidateProperties; for details, please refer to the related documentation provided for that property.

Protected Functions

override void Awake ( )
override void Start ( )
override void DoPreprocess ( )
override RayInteractable ComputeCandidate ( )
override int ComputeCandidateTiebreaker
override void InteractableSelected
( RayInteractable interactable )
override void InteractableUnselected
( RayInteractable interactable )
override void DoSelectUpdate ( )
virtual override Pose ComputePointerPose ( )

Member Functions

Injects all required dependencies for a dynamically instantiated RayInteractor; effectively wraps InjectSelector(ISelector) and InjectRayOrigin(Transform).
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets an ISelector for a dynamically instantiated RayInteractor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets a Unity Transform representing the raycast origin and direction for a dynamically instantiated RayInteractor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Sets the equal distance threshold for a dynamically instantiated RayInteractor.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon