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

HandGrabInteractor Class

Enables hand grab for objects within arm's reach that have a <cref="GrabInteractable" />.
When grabbing an object, the hands visually snap to any <cref="HandPose" /> you've provided. To enable grab for controllers, use GrabInteractor.

Properties

FingersStrength : float
[Get]
Signature
float Oculus.Interaction.HandGrab.HandGrabInteractor.FingersStrength
Hand : IHand
[Get]
Signature
IHand Oculus.Interaction.HandGrab.HandGrabInteractor.Hand
HandGrabApi : HandGrabAPI
[Get]
Signature
HandGrabAPI Oculus.Interaction.HandGrab.HandGrabInteractor.HandGrabApi
HandGrabTarget : HandGrabTarget
[Get]
Signature
HandGrabTarget Oculus.Interaction.HandGrab.HandGrabInteractor.HandGrabTarget
HoverOnZeroStrength : bool
[Get][Set]
Signature
bool Oculus.Interaction.HandGrab.HandGrabInteractor.HoverOnZeroStrength
IsGrabbing : bool
[Get]
Signature
virtual bool Oculus.Interaction.HandGrab.HandGrabInteractor.IsGrabbing
Movement : IMovement
[Get][Set]
Signature
IMovement Oculus.Interaction.HandGrab.HandGrabInteractor.Movement
MovementFinished : bool
[Get][Set]
Signature
bool Oculus.Interaction.HandGrab.HandGrabInteractor.MovementFinished
PalmPoint : Transform
[Get]
Signature
Transform Oculus.Interaction.HandGrab.HandGrabInteractor.PalmPoint
PinchPoint : Transform
[Get]
Signature
Transform Oculus.Interaction.HandGrab.HandGrabInteractor.PinchPoint
Rigidbody : Rigidbody
[Get]
Signature
Rigidbody Oculus.Interaction.HandGrab.HandGrabInteractor.Rigidbody
SupportedGrabTypes : GrabTypeFlags
[Get]
Signature
GrabTypeFlags Oculus.Interaction.HandGrab.HandGrabInteractor.SupportedGrabTypes
TargetInteractable : IHandGrabInteractable
[Get]
Signature
IHandGrabInteractable Oculus.Interaction.HandGrab.HandGrabInteractor.TargetInteractable
VelocityCalculator : IThrowVelocityCalculator
[Get][Set]
Signature
IThrowVelocityCalculator Oculus.Interaction.HandGrab.HandGrabInteractor.VelocityCalculator
WristPoint : Transform
[Get]
Signature
Transform Oculus.Interaction.HandGrab.HandGrabInteractor.WristPoint
WristStrength : float
[Get]
Signature
float Oculus.Interaction.HandGrab.HandGrabInteractor.WristStrength
WristToGrabPoseOffset : Pose
[Get]
Signature
Pose Oculus.Interaction.HandGrab.HandGrabInteractor.WristToGrabPoseOffset

Protected Methods

Awake ()
Signature
override void Oculus.Interaction.HandGrab.HandGrabInteractor.Awake()
Returns
override void
ComputeCandidate ()
Compute the best interactable to snap to.
In order to do it the method measures the score from the current grip pose to the closes pose in the surfaces of each one of the interactables in the registry. Even though it returns the best interactable, it also saves the entire Snap pose to it in which the exact pose within the surface is already recorded to avoid recalculations within the same frame.
Signature
override HandGrabInteractable Oculus.Interaction.HandGrab.HandGrabInteractor.ComputeCandidate()
Returns
override HandGrabInteractable  The best interactable to snap the hand to.
ComputePointerPose ()
Signature
override Pose Oculus.Interaction.HandGrab.HandGrabInteractor.ComputePointerPose()
Returns
override Pose
ComputeShouldSelect ()
Signature
override bool Oculus.Interaction.HandGrab.HandGrabInteractor.ComputeShouldSelect()
Returns
override bool
ComputeShouldUnselect ()
Signature
override bool Oculus.Interaction.HandGrab.HandGrabInteractor.ComputeShouldUnselect()
Returns
override bool
DoHoverUpdate ()
Each call while the interactor is hovering, it checks whether there is an interaction being hovered and sets the target snap pose to it.
In the HandToObject snapping behaviors this is relevant as the hand can approach the object progressively even before a true grab starts.
Signature
override void Oculus.Interaction.HandGrab.HandGrabInteractor.DoHoverUpdate()
Returns
override void
DoSelectUpdate ()
Each call while the hand is selecting/grabbing an interactable, it moves the item to the new position while also attracting it towards the hand if the snapping mode requires it.
In some cases the parameter can be null, for example if the selection was interrupted by another hand grabbing the object. In those cases it will come out of the release state once the grabbing gesture properly finishes.
Signature
override void Oculus.Interaction.HandGrab.HandGrabInteractor.DoSelectUpdate()
Returns
override void
HandlePointerEventRaised ( evt )
Signature
override void Oculus.Interaction.HandGrab.HandGrabInteractor.HandlePointerEventRaised(PointerEvent evt)
Parameters
Returns
override void
InteractableSelected ( interactable )
When a new interactable is selected, start the grab at the ideal point.
When snapping is involved that can be a point in the interactable offset from the hand which will be stored to progressively reduced it in the next updates, effectively attracting the object towards the hand. When no snapping is involved the point will be the grip point of the hand directly. Note: ideally this code would be in InteractableSelected but it needs to be called before the object is marked as active.
Signature
override void Oculus.Interaction.HandGrab.HandGrabInteractor.InteractableSelected(HandGrabInteractable interactable)
Parameters
interactable: HandGrabInteractable  The selected interactable
Returns
override void
InteractableSet ( interactable )
Signature
override void Oculus.Interaction.HandGrab.HandGrabInteractor.InteractableSet(HandGrabInteractable interactable)
Parameters
interactable: HandGrabInteractable
Returns
override void
InteractableUnselected ( interactable )
When releasing an active interactable, calculate the releasing point in similar fashion to InteractableSelected.
Signature
override void Oculus.Interaction.HandGrab.HandGrabInteractor.InteractableUnselected(HandGrabInteractable interactable)
Parameters
interactable: HandGrabInteractable  The released interactable
Returns
override void
InteractableUnset ( interactable )
Signature
override void Oculus.Interaction.HandGrab.HandGrabInteractor.InteractableUnset(HandGrabInteractable interactable)
Parameters
interactable: HandGrabInteractable
Returns
override void
Reset ()
Signature
virtual void Oculus.Interaction.HandGrab.HandGrabInteractor.Reset()
Returns
void
Start ()
Signature
override void Oculus.Interaction.HandGrab.HandGrabInteractor.Start()
Returns
override void

Methods

CanSelect ( interactable )
Signature
override bool Oculus.Interaction.HandGrab.HandGrabInteractor.CanSelect(HandGrabInteractable interactable)
Parameters
interactable: HandGrabInteractable
Returns
override bool
ForceRelease ()
Forces the interactor to deselect the currently grabbed interactable (if any).
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractor.ForceRelease()
Returns
void
ForceSelect ( interactable , allowManualRelease )
Forces the interactor to select the passed interactable, which will be grabbed in the next interaction iteration.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractor.ForceSelect(HandGrabInteractable interactable, bool allowManualRelease=false)
Parameters
interactable: HandGrabInteractable  The interactable to grab.
allowManualRelease: bool  If false, the interactable can only be released by calling ForceRelease.
Returns
void
GrabbingFingers ()
Returns the fingers that are grabbing the interactable.
Signature
HandFingerFlags Oculus.Interaction.HandGrab.HandGrabInteractor.GrabbingFingers()
Returns
HandFingerFlags
InjectAllHandGrabInteractor ( handGrabApi , grabOrigin , hand , rigidbody , supportedGrabTypes )
Adds everything contained in <cref="HandGrabInteractor"/> to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractor.InjectAllHandGrabInteractor(HandGrabAPI handGrabApi, Transform grabOrigin, IHand hand, Rigidbody rigidbody, GrabTypeFlags supportedGrabTypes)
Parameters
handGrabApi: HandGrabAPI
grabOrigin: Transform
hand: IHand
rigidbody: Rigidbody
supportedGrabTypes: GrabTypeFlags
Returns
void
InjectGrabOrigin ( grabOrigin )
Adds a grab origin to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractor.InjectGrabOrigin(Transform grabOrigin)
Parameters
grabOrigin: Transform
Returns
void
InjectHand ( hand )
Adds a <cref="IHand" /> to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractor.InjectHand(IHand hand)
Parameters
hand: IHand
Returns
void
InjectHandGrabApi ( handGrabAPI )
Adds a <cref="HandGrabAPI" /> to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractor.InjectHandGrabApi(HandGrabAPI handGrabAPI)
Parameters
handGrabAPI: HandGrabAPI
Returns
void
InjectOptionalGripCollider ( gripCollider )
Adds a grip collider to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractor.InjectOptionalGripCollider(Collider gripCollider)
Parameters
gripCollider: Collider
Returns
void
InjectOptionalGripPoint ( gripPoint )
Adds a grip point to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractor.InjectOptionalGripPoint(Transform gripPoint)
Parameters
gripPoint: Transform
Returns
void
InjectOptionalPinchCollider ( pinchCollider )
Adds a pinch collider to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractor.InjectOptionalPinchCollider(Collider pinchCollider)
Parameters
pinchCollider: Collider
Returns
void
InjectOptionalPinchPoint ( pinchPoint )
Adds a pinch point to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractor.InjectOptionalPinchPoint(Transform pinchPoint)
Parameters
pinchPoint: Transform
Returns
void
InjectOptionalVelocityCalculator ( velocityCalculator )
Adds a velocity calculator to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractor.InjectOptionalVelocityCalculator(IThrowVelocityCalculator velocityCalculator)
Parameters
velocityCalculator: IThrowVelocityCalculator
Returns
void
InjectRigidbody ( rigidbody )
Adds a Rigidbody to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractor.InjectRigidbody(Rigidbody rigidbody)
Parameters
rigidbody: Rigidbody
Returns
void
InjectSupportedGrabTypes ( supportedGrabTypes )
Adds a list of <cref="GrabTypeFlags" /> to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractor.InjectSupportedGrabTypes(GrabTypeFlags supportedGrabTypes)
Parameters
supportedGrabTypes: GrabTypeFlags
Returns
void
SetComputeCandidateOverride ( computeCandidate , shouldClearOverrideOnSelect )
Signature
override void Oculus.Interaction.HandGrab.HandGrabInteractor.SetComputeCandidateOverride(Func< HandGrabInteractable > computeCandidate, bool shouldClearOverrideOnSelect=true)
Parameters
computeCandidate: Func< HandGrabInteractable >
shouldClearOverrideOnSelect: bool
Returns
override void
Unselect ()
Signature
override void Oculus.Interaction.HandGrab.HandGrabInteractor.Unselect()
Returns
override void