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

HandGrabInteraction Class

Helper class for Hand Grabbing types such as HandGrabInteractor/HandGrabInteractable and DistanceHandGrabInteractor/DistanceHandGrabInteractable.
This class keeps track of the grabbing anchors and updates the target and movement during a Hand Grab interaction.

Static Member Functions

Obsolete: Calculates a new target.
That is the point of the interactable at which the hand grab interaction will occur. This function is obsolete and should be replaced by calls to CalculateBestGrab(IHandGrabInteractor, IHandGrabInteractable, GrabTypeFlags, out GrabTypeFlags, ref HandGrabResult) in new code.
Parameters
interactable
The interactable to be HandGrabbed
grabTypes
The supported GrabTypes
anchorMode
The anchor to use for grabbing
handGrabResult
The a variable to store the result
Returns
True if a valid pose was found
Obsolete: this is a convenience method for retrieving the current grab type from an IHandGrabInteractor.
This method should not be used in new code; the value can instead be directly retrieved from the HandGrabTarget.Anchor property of the interactor's IHandGrabState.HandGrabTarget: handGrabInteractor.HandGrabTarget.Anchor.
Parameters
handGrabInteractor
The interactor to query for its current grab type
Returns
The current grab type of the interactor
Extension method for IHandGrabInteractors which calculates a new interaction target.
That is the point of the interactable at which the hand grab interaction will occur.
Parameters
handGrabInteractor
The interactor grabbing
interactable
The interactable to be HandGrabbed
grabFlags
The supported GrabTypes
activeGrabFlags
The anchor to use for grabbing
result
The a variable to store the result
Initiates the movement of the IHandGrabInteractable with the current HandGrabTarget.
Parameters
handGrabInteractor
The interactor grabbing
interactable
The interactable to be HandGrabbed
Extension method for IHandGrabInteractor which retrivies the current pose of the current grabbing point.
Returns
The pose of the current grabbing point in world space
Extension method for IHandGrabInteractor which calculates the GrabPoseScore for a given interactable with the specified grab modes.
Parameters
handGrabInteractor
The interactor grabbing
interactable
The interactable to measure to
grabTypes
The supported grab types for the grab
result
Calculating the score requires finding the best grab pose. It is stored here.
Returns
The best GrabPoseScore considering the grabtypes at the interactable
Extension method for IHandGrabInteractor which indicates if an IHandGrabInteractor can interact with (hover and select) a given IHandGrabInteractable.
This depends on the handedness and the valid grab types of both elements.
Parameters
handGrabInteractor
The interactor grabbing
handGrabInteractable
The interactable to be grabbed
Returns
True if the interactor could grab the interactable
Extension method for IHandGrabInteractor which calculates the offset from the wrist to the actual grabbing point defined by the current anchor in the interactor HandGrabTarget.
Parameters
handGrabInteractor
The interactor whose HandGrabTarget to inspect
Returns
The local offset from the wrist to the grab point
Extension method for IHandGrabInteractor which calculates the strength of the fingers of an interactor trying (or grabbing) an interactable.
"Strength" is a measure of of how similar/different the finger's state is to what the system considers "grabbing"; for a more detailed overview, see the documentation for IHand.GetFingerPinchStrength(HandFinger).
Parameters
handGrabInteractor
The interactor grabbing
handGrabInteractable
The interactable being grabbed
handGrabTypes
A filter for the grab types to calculate
includeSelecting
Compute also fingers that are selecting
Returns
The maximum strength for the grabbing fingers, normalized
Extension method for IHandGrabInteractor which calculates whether the interactor should select a given IHandGrabInteractable.
This is conceptually related to Interactor<TInteractor, TInteractable>.ComputeShouldSelect, but rather than being a specific part of the general processing flow it's used in several places throughout the grab interaction logic.
Parameters
handGrabInteractor
The interactor
handGrabInteractable
The interactable
Returns
True if the handGrabInteractor should select (grab) the handGrabInteractable , false otherwise
Extension method for IHandGrabInteractor which calculates whether the interactor should unselect a given IHandGrabInteractable.
This is conceptually related to Interactor<TInteractor, TInteractable>.ComputeShouldUnselect, but rather than being a specific part of the general processing flow it's used in several places throughout the grab interaction logic.
Parameters
handGrabInteractor
The interactor
handGrabInteractable
The interactable
Returns
True if the handGrabInteractor should unselect (release) the handGrabInteractable , false otherwise
Extension method for IHandGrabInteractor which builds a bit flag enumeration of the fingers which are currently considered to be grabbing.
Note that, because the returned value is a bit mask, it should not be checked directly against enum values as it may not appear in the enum at all. Instead, bitwise operations should be used to check for the presence of enum values within the mask: i.e., (mask & <see cref="HandFingerFlags.Thumb"/>) != 0.
Parameters
handGrabInteractor
The interactor
handGrabInteractable
The interactable being grabbed
Returns
A bit mask of HandFingerFlags values indicating which fingers are currently grabbing
Extension method for IHandGrabInteractor which calculates the root of a grab and the practical offset to the grabbing point.
Parameters
handGrabInteractor
The interactor grabbing
anchorMode
The grab types to be used
pose
The root of the grab pose to use
offset
The offset form the root for accurate scoring
Did you find this page helpful?
Thumbs up icon
Thumbs down icon