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

HandGrabInteraction Class

Helper class for Hand Grabbing objects.
This class keeps track of the grabbing anchors and updates the target and movement during a Hand Grab interaction.

Static Methods

CalculateBestGrab ( handGrabInteractor , interactable , grabFlags , activeGrabFlags , result )
Calculates a new target.
That is the point of the interactable at which the HandGrab will happen.
Signature
static void Oculus.Interaction.HandGrab.HandGrabInteraction.CalculateBestGrab(this IHandGrabInteractor handGrabInteractor, IHandGrabInteractable interactable, GrabTypeFlags grabFlags, out GrabTypeFlags activeGrabFlags, ref HandGrabResult result)
Parameters
handGrabInteractor: this IHandGrabInteractor  The interactor grabbing
interactable: IHandGrabInteractable  The interactable to be HandGrabbed
grabFlags: GrabTypeFlags  The supported GrabTypes
activeGrabFlags: out GrabTypeFlags  The anchor to use for grabbing
result: ref HandGrabResult  The a variable to store the result
Returns
void
CanInteractWith ( handGrabInteractor , handGrabInteractable )
Indicates if an interactor can interact with (hover and select) and interactable.
This depends on the handedness and the valid grab types of both elements
Signature
static bool Oculus.Interaction.HandGrab.HandGrabInteraction.CanInteractWith(this IHandGrabInteractor handGrabInteractor, IHandGrabInteractable handGrabInteractable)
Parameters
handGrabInteractor: this IHandGrabInteractor  The interactor grabbing
handGrabInteractable: IHandGrabInteractable  The interactable to be grabbed
Returns
bool  True if the interactor could grab the interactable
ComputeHandGrabScore ( handGrabInteractor , handGrabInteractable , handGrabTypes , includeSelecting )
Calculates the strenght of the fingers of an interactor trying (or grabbing) an interactable.
Signature
static float Oculus.Interaction.HandGrab.HandGrabInteraction.ComputeHandGrabScore(IHandGrabInteractor handGrabInteractor, IHandGrabInteractable handGrabInteractable, out GrabTypeFlags handGrabTypes, bool includeSelecting=false)
Parameters
handGrabInteractor: IHandGrabInteractor  The interactor grabbing
handGrabInteractable: IHandGrabInteractable  The interactable being grabbed
handGrabTypes: out GrabTypeFlags  A filter for the grab types to calculate
includeSelecting: bool  Compute also fingers that are selecting
Returns
float  The maximum strength for the grabbing fingers, normalized
ComputeShouldSelect ( handGrabInteractor , handGrabInteractable )
Signature
static GrabTypeFlags Oculus.Interaction.HandGrab.HandGrabInteraction.ComputeShouldSelect(this IHandGrabInteractor handGrabInteractor, IHandGrabInteractable handGrabInteractable)
Parameters
handGrabInteractor: this IHandGrabInteractor
handGrabInteractable: IHandGrabInteractable
Returns
GrabTypeFlags
ComputeShouldUnselect ( handGrabInteractor , handGrabInteractable )
Signature
static GrabTypeFlags Oculus.Interaction.HandGrab.HandGrabInteraction.ComputeShouldUnselect(this IHandGrabInteractor handGrabInteractor, IHandGrabInteractable handGrabInteractable)
Parameters
handGrabInteractor: this IHandGrabInteractor
handGrabInteractable: IHandGrabInteractable
Returns
GrabTypeFlags
CurrentGrabType ( handGrabInteractor )
Signature
static GrabTypeFlags Oculus.Interaction.HandGrab.HandGrabInteraction.CurrentGrabType(this IHandGrabInteractor handGrabInteractor)
Parameters
handGrabInteractor: this IHandGrabInteractor
Returns
GrabTypeFlags
GenerateMovement ( handGrabInteractor , interactable )
Initiates the movement of the Interactable with the current HandGrabTarget.
Signature
static IMovement Oculus.Interaction.HandGrab.HandGrabInteraction.GenerateMovement(this IHandGrabInteractor handGrabInteractor, IHandGrabInteractable interactable)
Parameters
handGrabInteractor: this IHandGrabInteractor  The interactor grabbing
interactable: IHandGrabInteractable  The interactable to be HandGrabbed
Returns
IMovement
GetGrabOffset ( handGrabInteractor )
Calculates the offset from the Wrist to the actual grabbing point defined by the current anchor in the interactor HandGrabTarget.
Signature
static Pose Oculus.Interaction.HandGrab.HandGrabInteraction.GetGrabOffset(this IHandGrabInteractor handGrabInteractor)
Parameters
handGrabInteractor: this IHandGrabInteractor  The interactor whose HandGrabTarget to inspect
Returns
Pose  The local offset from the wrist to the grab point
GetHandGrabPose ( handGrabInteractor )
Gets the current pose of the current grabbing point.
Signature
static Pose Oculus.Interaction.HandGrab.HandGrabInteraction.GetHandGrabPose(this IHandGrabInteractor handGrabInteractor)
Parameters
handGrabInteractor: this IHandGrabInteractor
Returns
Pose  The pose in world coordinates
GetPoseOffset ( handGrabInteractor , anchorMode , pose , offset )
Calculates the root of a grab and the practica offset to the grabbing point.
Signature
static void Oculus.Interaction.HandGrab.HandGrabInteraction.GetPoseOffset(this IHandGrabInteractor handGrabInteractor, GrabTypeFlags anchorMode, out Pose pose, out Pose offset)
Parameters
handGrabInteractor: this IHandGrabInteractor  The interactor grabbing
anchorMode: GrabTypeFlags  The grab types to be used
pose: out Pose  The root of the grab pose to use
offset: out Pose  The offset form the root for accurate scoring
Returns
void
GetPoseScore ( handGrabInteractor , interactable , grabTypes , result )
Calculates the GrabPoseScore for an interactable with the given grab modes.
Signature
static GrabPoseScore Oculus.Interaction.HandGrab.HandGrabInteraction.GetPoseScore(this IHandGrabInteractor handGrabInteractor, IHandGrabInteractable interactable, GrabTypeFlags grabTypes, ref HandGrabResult result)
Parameters
handGrabInteractor: this IHandGrabInteractor  The interactor grabbing
interactable: IHandGrabInteractable  The interactable to measure to
grabTypes: GrabTypeFlags  The supported grab types for the grab
result: ref HandGrabResult  Calculating the score requires finding the best grab pose. It is stored here.
Returns
GrabPoseScore  The best GrabPoseScore considering the grabtypes at the interactable
GrabbingFingers ( handGrabInteractor , handGrabInteractable )
Signature
static HandFingerFlags Oculus.Interaction.HandGrab.HandGrabInteraction.GrabbingFingers(this IHandGrabInteractor handGrabInteractor, IHandGrabInteractable handGrabInteractable)
Parameters
handGrabInteractor: this IHandGrabInteractor
handGrabInteractable: IHandGrabInteractable
Returns
HandFingerFlags
TryCalculateBestGrab ( handGrabInteractor , interactable , grabTypes , anchorMode , handGrabResult )
Calculates a new target.
That is the point of the interactable at which the HandGrab will happen.
Signature
static bool Oculus.Interaction.HandGrab.HandGrabInteraction.TryCalculateBestGrab(this IHandGrabInteractor handGrabInteractor, IHandGrabInteractable interactable, GrabTypeFlags grabTypes, out HandGrabTarget.GrabAnchor anchorMode, ref HandGrabResult handGrabResult)
Parameters
handGrabInteractor: this IHandGrabInteractor
interactable: IHandGrabInteractable  The interactable to be HandGrabbed
grabTypes: GrabTypeFlags  The supported GrabTypes
anchorMode: out HandGrabTarget.GrabAnchor  The anchor to use for grabbing
handGrabResult: ref HandGrabResult  The a variable to store the result
Returns
bool  True if a valid pose was found