API reference

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

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

Protected Functions

virtual void Reset ( )
override void Awake ( )
override void Start ( )

Member Functions

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