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.

Fields

CandidateProperties : override object
Implementation of Interactor<TInteractor, TInteractable>.CandidateProperties; for details, please refer to the related documentation provided for that property.
Signature
override object Oculus.Interaction.RayInteractor.CandidateProperties

Properties

CollisionInfo : SurfaceHit
[Get]
If the most recent raycast hit a RayInteractable, information about that hit will be exposed here.
Otherwise, this property will be null.
Signature
SurfaceHit Oculus.Interaction.RayInteractor.CollisionInfo
End : Vector3
[Get][Set]
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.
Signature
Vector3 Oculus.Interaction.RayInteractor.End
Forward : Vector3
[Get]
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).
Signature
Vector3 Oculus.Interaction.RayInteractor.Forward
MaxRayLength : float
[Get][Set]
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.
Signature
float Oculus.Interaction.RayInteractor.MaxRayLength
Origin : Vector3
[Get]
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).
Signature
Vector3 Oculus.Interaction.RayInteractor.Origin
Ray : Ray
[Get]
The ray which is used when raycasting for interaction.
This is derived from Origin and Forward.
Signature
Ray Oculus.Interaction.RayInteractor.Ray
Rotation : Quaternion
[Get]
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).
Signature
Quaternion Oculus.Interaction.RayInteractor.Rotation

Protected Methods

Awake ()
Signature
override void Oculus.Interaction.RayInteractor.Awake()
Returns
override void
ComputeCandidate ()
Signature
override RayInteractable Oculus.Interaction.RayInteractor.ComputeCandidate()
Returns
override RayInteractable
ComputeCandidateTiebreaker ( a , b )
Signature
override int Oculus.Interaction.RayInteractor.ComputeCandidateTiebreaker(RayInteractable a, RayInteractable b)
Returns
override int
ComputePointerPose ()
Signature
override Pose Oculus.Interaction.RayInteractor.ComputePointerPose()
Returns
override Pose
DoHoverUpdate ()
Signature
override void Oculus.Interaction.RayInteractor.DoHoverUpdate()
Returns
override void
DoPreprocess ()
Signature
override void Oculus.Interaction.RayInteractor.DoPreprocess()
Returns
override void
DoSelectUpdate ()
Signature
override void Oculus.Interaction.RayInteractor.DoSelectUpdate()
Returns
override void
InteractableSelected ( interactable )
Signature
override void Oculus.Interaction.RayInteractor.InteractableSelected(RayInteractable interactable)
Parameters
interactable: RayInteractable
Returns
override void
InteractableUnselected ( interactable )
Signature
override void Oculus.Interaction.RayInteractor.InteractableUnselected(RayInteractable interactable)
Parameters
interactable: RayInteractable
Returns
override void
Start ()
Signature
override void Oculus.Interaction.RayInteractor.Start()
Returns
override void

Methods

InjectAllRayInteractor ( selector , rayOrigin )
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.
Signature
void Oculus.Interaction.RayInteractor.InjectAllRayInteractor(ISelector selector, Transform rayOrigin)
Parameters
selector: ISelector
rayOrigin: Transform
Returns
void
InjectOptionalEqualDistanceThreshold ( equalDistanceThreshold )
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.
Signature
void Oculus.Interaction.RayInteractor.InjectOptionalEqualDistanceThreshold(float equalDistanceThreshold)
Parameters
equalDistanceThreshold: float
Returns
void
InjectRayOrigin ( rayOrigin )
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.
Signature
void Oculus.Interaction.RayInteractor.InjectRayOrigin(Transform rayOrigin)
Parameters
rayOrigin: Transform
Returns
void
InjectSelector ( selector )
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.
Signature
void Oculus.Interaction.RayInteractor.InjectSelector(ISelector selector)
Parameters
selector: ISelector
Returns
void