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

HandGrabInteractable Class

Makes an object grabbable by hands so long as it's within arm's reach.
A HandGrabInteractable indicates the properties about how a hand can HandGrab an object. It specifies the fingers that must perform the grab and the release and generates the events for the Pointable to move the object. Optionally it can reference a list of differently scaled HandGrabPoses to inform the interactor about the best pose the hand should adopt when grabbing the object with different sized hands.

Properties

Colliders : Collider[]
[Get]
Signature
Collider [] Oculus.Interaction.HandGrab.HandGrabInteractable.Colliders
HandAlignment : HandAlignType
[Get][Set]
Signature
HandAlignType Oculus.Interaction.HandGrab.HandGrabInteractable.HandAlignment
HandGrabPoses : List< HandGrabPose >
[Get]
Signature
List<HandGrabPose> Oculus.Interaction.HandGrab.HandGrabInteractable.HandGrabPoses
PalmGrabRules : GrabbingRule
[Get]
Signature
GrabbingRule Oculus.Interaction.HandGrab.HandGrabInteractable.PalmGrabRules
PinchGrabRules : GrabbingRule
[Get]
Signature
GrabbingRule Oculus.Interaction.HandGrab.HandGrabInteractable.PinchGrabRules
RelativeTo : Transform
[Get]
General getter for the transform of the object this interactable refers to.
Signature
Transform Oculus.Interaction.HandGrab.HandGrabInteractable.RelativeTo
ResetGrabOnGrabsUpdated : bool
[Get][Set]
Signature
bool Oculus.Interaction.HandGrab.HandGrabInteractable.ResetGrabOnGrabsUpdated
Rigidbody : Rigidbody
[Get]
Signature
Rigidbody Oculus.Interaction.HandGrab.HandGrabInteractable.Rigidbody
ScoreModifier : PoseMeasureParameters
[Get]
Signature
PoseMeasureParameters Oculus.Interaction.HandGrab.HandGrabInteractable.ScoreModifier
Slippiness : float
[Get][Set]
Signature
float Oculus.Interaction.HandGrab.HandGrabInteractable.Slippiness
SupportedGrabTypes : GrabTypeFlags
[Get]
Signature
GrabTypeFlags Oculus.Interaction.HandGrab.HandGrabInteractable.SupportedGrabTypes
UsesHandPose : bool
[Get]
Signature
bool Oculus.Interaction.HandGrab.HandGrabInteractable.UsesHandPose

Protected Methods

Awake ()
Signature
override void Oculus.Interaction.HandGrab.HandGrabInteractable.Awake()
Returns
override void
Reset ()
Signature
virtual void Oculus.Interaction.HandGrab.HandGrabInteractable.Reset()
Returns
void
Start ()
Signature
override void Oculus.Interaction.HandGrab.HandGrabInteractable.Start()
Returns
override void

Methods

ApplyVelocities ( linearVelocity , angularVelocity )
Applies velocities to the interactable's <cref="PhysicsGrabbable" /> if it has one.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractable.ApplyVelocities(Vector3 linearVelocity, Vector3 angularVelocity)
Parameters
linearVelocity: Vector3  The linear velocity to apply.
angularVelocity: Vector3  The angular velocity to apply.
Returns
void
CalculateBestPose ( userPose , handScale , handedness , result )
Determines the best pose for the hand to snap to.
Signature
bool Oculus.Interaction.HandGrab.HandGrabInteractable.CalculateBestPose(Pose userPose, float handScale, Handedness handedness, ref HandGrabResult result)
Parameters
userPose: Pose  The pose of the hand.
handScale: float  The scale of the hand.
handedness: Handedness  The handedness of the hand.
result: ref HandGrabResult  The best pose.
Returns
bool
CalculateBestPose ( userPose , offset , relativeTo , handScale , handedness , result )
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractable.CalculateBestPose(in Pose userPose, in Pose offset, Transform relativeTo, float handScale, Handedness handedness, ref HandGrabResult result)
Parameters
userPose: in Pose
offset: in Pose
relativeTo: Transform
handScale: float
handedness: Handedness
result: ref HandGrabResult
Returns
void
GenerateMovement ( from , to )
When you grab the object, this determines where the object currently is and where it should move.
Signature
IMovement Oculus.Interaction.HandGrab.HandGrabInteractable.GenerateMovement(in Pose from, in Pose to)
Parameters
from: in Pose  The starting position.
to: in Pose  The ending position.
Returns
IMovement
InjectAllHandGrabInteractable ( supportedGrabTypes , rigidbody , pinchGrabRules , palmGrabRules )
Adds all required scripts for <cref="HandGrabInteractable" /> to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractable.InjectAllHandGrabInteractable(GrabTypeFlags supportedGrabTypes, Rigidbody rigidbody, GrabbingRule pinchGrabRules, GrabbingRule palmGrabRules)
Parameters
supportedGrabTypes: GrabTypeFlags
rigidbody: Rigidbody
pinchGrabRules: GrabbingRule
palmGrabRules: GrabbingRule
Returns
void
InjectOptionalHandGrabPoses ( handGrabPoses )
Adds hand grab poses to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractable.InjectOptionalHandGrabPoses(List< HandGrabPose > handGrabPoses)
Parameters
handGrabPoses: List< HandGrabPose >
Returns
void
InjectOptionalMovementProvider ( provider )
Adds a movement provider to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractable.InjectOptionalMovementProvider(IMovementProvider provider)
Parameters
Returns
void
InjectOptionalPhysicsGrabbable ( physicsGrabbable )
Adds a physics grabbable to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractable.InjectOptionalPhysicsGrabbable(PhysicsGrabbable physicsGrabbable)
Parameters
physicsGrabbable: PhysicsGrabbable
Returns
void
InjectOptionalScoreModifier ( scoreModifier )
Adds a score modifier to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractable.InjectOptionalScoreModifier(PoseMeasureParameters scoreModifier)
Parameters
scoreModifier: PoseMeasureParameters
Returns
void
InjectPalmGrabRules ( palmGrabRules )
Adds palm grab rules to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractable.InjectPalmGrabRules(GrabbingRule palmGrabRules)
Parameters
palmGrabRules: GrabbingRule
Returns
void
InjectPinchGrabRules ( pinchGrabRules )
Adds pinch grab rules to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractable.InjectPinchGrabRules(GrabbingRule pinchGrabRules)
Parameters
pinchGrabRules: GrabbingRule
Returns
void
InjectRigidbody ( rigidbody )
Adds a Rigidbody to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractable.InjectRigidbody(Rigidbody rigidbody)
Parameters
rigidbody: Rigidbody
Returns
void
InjectSupportedGrabTypes ( supportedGrabTypes )
Adds supported grab types to a dynamically instantiated GameObject.
Signature
void Oculus.Interaction.HandGrab.HandGrabInteractable.InjectSupportedGrabTypes(GrabTypeFlags supportedGrabTypes)
Parameters
supportedGrabTypes: GrabTypeFlags
Returns
void
SupportsHandedness ( handedness )
Checks if the pose supports grabbing with the given hand.
Signature
bool Oculus.Interaction.HandGrab.HandGrabInteractable.SupportsHandedness(Handedness handedness)
Parameters
handedness: Handedness
Returns
bool