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

GrabInteractable Class

The GrabInteractable class enables objects to be grabbable by controllers, provided they are within arm's reach.
This class implements interfaces for handling rigidbody physics and collider references, facilitating detailed control over the interaction dynamics.

Fields

Colliders : Collider []
Signature
Collider [] Oculus.Interaction.GrabInteractable.Colliders
Rigidbody : Rigidbody
Provides access to the Rigidbody component associated with the interactable object, allowing for physics-based interactions.
Signature
Rigidbody Oculus.Interaction.GrabInteractable.Rigidbody

Properties

ReleaseDistance : float
[Get][Set]
Specifies the distance at which the object will automatically be released from the grab, providing a limit to maintain realistic interactions.
Signature
float Oculus.Interaction.GrabInteractable.ReleaseDistance
ResetGrabOnGrabsUpdated : bool
[Get][Set]
Indicates whether the grab should be reset when the grab points are updated, allowing for dynamic adjustment during ongoing interactions.
Signature
bool Oculus.Interaction.GrabInteractable.ResetGrabOnGrabsUpdated
UseClosestPointAsGrabSource : bool
[Get][Set]
Determines whether the closest point to the interactor should be used as the grab source, enhancing precision in grab interactions.
Signature
bool Oculus.Interaction.GrabInteractable.UseClosestPointAsGrabSource

Protected Methods

Awake ()
Signature
override void Oculus.Interaction.GrabInteractable.Awake()
Returns
override void
Start ()
Signature
override void Oculus.Interaction.GrabInteractable.Start()
Returns
override void

Methods

ApplyVelocities ( linearVelocity , angularVelocity )
Applies specified linear and angular velocities to the interactable's Rigidbody, if it has one, facilitating realistic physics interactions.
Signature
void Oculus.Interaction.GrabInteractable.ApplyVelocities(Vector3 linearVelocity, Vector3 angularVelocity)
Parameters
linearVelocity: Vector3  The linear velocity to apply.
angularVelocity: Vector3  The angular velocity to apply.
Returns
void
GetGrabSourceForTarget ( target )
Calculates the grab source position for a given target, which determines the initial location from which the object will be grabbed.
Signature
Pose Oculus.Interaction.GrabInteractable.GetGrabSourceForTarget(Pose target)
Parameters
target: Pose  The pose of the interactor targeting the grabbable object.
Returns
Pose  The calculated Pose representing the grab source.
InjectAllGrabInteractable ( rigidbody )
Adds a Rigidbody to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.GrabInteractable.InjectAllGrabInteractable(Rigidbody rigidbody)
Parameters
rigidbody: Rigidbody
Returns
void
InjectOptionalGrabSource ( grabSource )
Optionally sets a specific transform as the grab source for the interactable, allowing for customized grab initiation points.
Signature
void Oculus.Interaction.GrabInteractable.InjectOptionalGrabSource(Transform grabSource)
Parameters
grabSource: Transform  The transform to be used as the grab source.
Returns
void
InjectOptionalPhysicsGrabbable ( physicsGrabbable )
Optionally adds a PhysicsGrabbable component to the interactable, which is now deprecated and should be replaced with Grabbable.
Signature
void Oculus.Interaction.GrabInteractable.InjectOptionalPhysicsGrabbable(PhysicsGrabbable physicsGrabbable)
Parameters
physicsGrabbable: PhysicsGrabbable  The PhysicsGrabbable component to be added.
Returns
void
InjectOptionalReleaseDistance ( releaseDistance )
Optionally sets a specific release distance for the interactable, defining how far the interactor can move before the grab is released.
Signature
void Oculus.Interaction.GrabInteractable.InjectOptionalReleaseDistance(float releaseDistance)
Parameters
releaseDistance: float  The release distance to be set.
Returns
void
InjectRigidbody ( rigidbody )
Adds a Rigidbody to the interactable, enabling physics interactions.
Signature
void Oculus.Interaction.GrabInteractable.InjectRigidbody(Rigidbody rigidbody)
Parameters
rigidbody: Rigidbody  The Rigidbody to be added to the interactable object.
Returns
void