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

GrabInteractor Class

The GrabInteractor class facilitates interaction with objects that have a GrabInteractable component.
It supports interaction via both controllers and hands, though the HandGrabInteractor is recommended for hand interactions. This class provides advanced control over grab interactions, including forced selection and release, and dynamic component injection.

Fields

Rigidbody : Rigidbody
Signature
Rigidbody Oculus.Interaction.GrabInteractor.Rigidbody

Properties

VelocityCalculator : IThrowVelocityCalculator
[Get][Set]
Signature
IThrowVelocityCalculator Oculus.Interaction.GrabInteractor.VelocityCalculator

Protected Methods

Awake ()
Signature
override void Oculus.Interaction.GrabInteractor.Awake()
Returns
override void
ComputeCandidate ()
Signature
override GrabInteractable Oculus.Interaction.GrabInteractor.ComputeCandidate()
Returns
override GrabInteractable
ComputePointerPose ()
Signature
override Pose Oculus.Interaction.GrabInteractor.ComputePointerPose()
Returns
override Pose
ComputeShouldUnselect ()
Signature
override bool Oculus.Interaction.GrabInteractor.ComputeShouldUnselect()
Returns
override bool
DoPreprocess ()
Signature
override void Oculus.Interaction.GrabInteractor.DoPreprocess()
Returns
override void
DoSelectUpdate ()
Signature
override void Oculus.Interaction.GrabInteractor.DoSelectUpdate()
Returns
override void
HandlePointerEventRaised ( evt )
Signature
override void Oculus.Interaction.GrabInteractor.HandlePointerEventRaised(PointerEvent evt)
Parameters
Returns
override void
InteractableSelected ( interactable )
Signature
override void Oculus.Interaction.GrabInteractor.InteractableSelected(GrabInteractable interactable)
Parameters
interactable: GrabInteractable
Returns
override void
InteractableUnselected ( interactable )
Signature
override void Oculus.Interaction.GrabInteractor.InteractableUnselected(GrabInteractable interactable)
Parameters
interactable: GrabInteractable
Returns
override void
Start ()
Signature
override void Oculus.Interaction.GrabInteractor.Start()
Returns
override void

Methods

ForceRelease ()
Forces the controller to unselect the currently selected GrabInteractable.
This method clears any overrides set by ForceSelect and reverts to the default selection behavior.
Signature
void Oculus.Interaction.GrabInteractor.ForceRelease()
Returns
void
ForceSelect ( interactable )
Forces the controller to select a specific GrabInteractable even if it is not the closest available option.
This method overrides the default selection process, allowing for programmatic control over which interactable is selected.
Signature
void Oculus.Interaction.GrabInteractor.ForceSelect(GrabInteractable interactable)
Parameters
interactable: GrabInteractable
Returns
void
InjectAllGrabInteractor ( selector , rigidbody )
Injects both a ISelector and a Rigidbody into a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.GrabInteractor.InjectAllGrabInteractor(ISelector selector, Rigidbody rigidbody)
Parameters
selector: ISelector  The selector component to be added.
rigidbody: Rigidbody  The Rigidbody component to be added.
Returns
void
InjectOptionalGrabCenter ( grabCenter )
Optionally adds a grab center to a dynamically instantiated GameObject, allowing for precise control over the center of grabbing operations by providing an external grab center transform.
Signature
void Oculus.Interaction.GrabInteractor.InjectOptionalGrabCenter(Transform grabCenter)
Parameters
grabCenter: Transform
Returns
void
InjectOptionalGrabTarget ( grabTarget )
Optionally adds a grab target to a dynamically instantiated GameObject, enabling targeted grabbing operations by providing an external grab target transform.
Signature
void Oculus.Interaction.GrabInteractor.InjectOptionalGrabTarget(Transform grabTarget)
Parameters
grabTarget: Transform
Returns
void
InjectOptionalVelocityCalculator ( velocityCalculator )
Adds a velocity calculator to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.GrabInteractor.InjectOptionalVelocityCalculator(IThrowVelocityCalculator velocityCalculator)
Parameters
velocityCalculator: IThrowVelocityCalculator
Returns
void
InjectRigidbody ( rigidbody )
Adds a Rigidbody to a dynamically instantiated GameObject, enhancing the physical interaction capabilities by providing an external Rigidbody component.
Signature
void Oculus.Interaction.GrabInteractor.InjectRigidbody(Rigidbody rigidbody)
Parameters
rigidbody: Rigidbody
Returns
void
InjectSelector ( selector )
Adds a ISelector to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.GrabInteractor.InjectSelector(ISelector selector)
Parameters
selector: ISelector  The external selector component to be added.
Returns
void
Unselect ()
This method unselects the currently selected interactable, and in addition reverts any selection overrides if necessary.
Signature
override void Oculus.Interaction.GrabInteractor.Unselect()
Returns
override void