HandPosing
A tool for quickly authoring hand poses to objects in VR using hand-tracking
HandPosing.Interaction.PhysicsGrabbable Class Reference

This custom version of the Grabbable, uses physic Joints instead of transforms to move the object. More...

Inheritance diagram for HandPosing.Interaction.PhysicsGrabbable:
HandPosing.Interaction.Grabbable

Public Member Functions

override void GrabBegin (BaseGrabber hand)
 When the grab begins, create the joint that will held the object to the grabber. The Anchor points of the Joint specify the offset to the grabber here. If a custom joint was provided, duplicate it and mimic its values, if not it will use a fixe joint. More...
 
override void GrabEnd (BaseGrabber hand, Vector3 linearVelocity, Vector3 angularVelocity)
 When the object is released, remove the joint associated to the hand. More...
 
override void MoveTo (Vector3 desiredPos, Quaternion desiredRot)
 Since Joints are automatically holding the grabbable to the grabber, this method is empty. More...
 
- Public Member Functions inherited from HandPosing.Interaction.Grabbable
void UnsuscribeGrabber ()
 Clear all grabs on this object. More...
 

Protected Member Functions

GameObject CreateJointHolder ()
 Creates a disabled GameObject for holding the data of the desired Custom Joint. More...
 
- Protected Member Functions inherited from HandPosing.Interaction.Grabbable
virtual void Awake ()
 

Properties

override bool MultiGrab [get]
 
- Properties inherited from HandPosing.Interaction.Grabbable
Rigidbody Body [get]
 
bool IsGrabbed [get]
 True if the object is being held by a Grabber. More...
 
Collider[] GrabPoints [get]
 General getter for the colliders eligible for grabbing. More...
 
virtual bool MultiGrab [get]
 True if the object can be held by multiple hands. Note: here not implemented, but supported by the class PhysicsGrabbable instead More...
 

Additional Inherited Members

- Public Attributes inherited from HandPosing.Interaction.Grabbable
Action< BaseGrabberOnGrabbed
 Event called when the object is grabbed More...
 
Action< BaseGrabberOnReleased
 Event called when the object is released More...
 
- Protected Attributes inherited from HandPosing.Interaction.Grabbable
bool immovable
 Set to true to avoid the Grabber to move this grabbable More...
 
Rigidbody _body
 

Detailed Description

This custom version of the Grabbable, uses physic Joints instead of transforms to move the object.

It support setting a custom joint for the grab, which can be specially useful when the grabbable has some constraints (a lever, a turning wheel) as it does not need to follow exactly the position of the hand.

Member Function Documentation

◆ CreateJointHolder()

GameObject HandPosing.Interaction.PhysicsGrabbable.CreateJointHolder ( )
protected

Creates a disabled GameObject for holding the data of the desired Custom Joint.

Returns
A children GameObject for holding Joint data.

◆ GrabBegin()

override void HandPosing.Interaction.PhysicsGrabbable.GrabBegin ( BaseGrabber  hand)
virtual

When the grab begins, create the joint that will held the object to the grabber. The Anchor points of the Joint specify the offset to the grabber here. If a custom joint was provided, duplicate it and mimic its values, if not it will use a fixe joint.

Parameters
handThe grabber hand

Reimplemented from HandPosing.Interaction.Grabbable.

◆ GrabEnd()

override void HandPosing.Interaction.PhysicsGrabbable.GrabEnd ( BaseGrabber  hand,
Vector3  linearVelocity,
Vector3  angularVelocity 
)
virtual

When the object is released, remove the joint associated to the hand.

Parameters
handHand that released the object.
linearVelocityLinear velocity of the throw.
angularVelocityAngular velocity of the throw.

Reimplemented from HandPosing.Interaction.Grabbable.

◆ MoveTo()

override void HandPosing.Interaction.PhysicsGrabbable.MoveTo ( Vector3  desiredPos,
Quaternion  desiredRot 
)
virtual

Since Joints are automatically holding the grabbable to the grabber, this method is empty.

Parameters
desiredPosThe desired position of the grabbable.
desiredRotThe desired rotation of the grabbable.

Reimplemented from HandPosing.Interaction.Grabbable.


The documentation for this class was generated from the following file: