UnityMol
1.0.25beta
|
Sets the grabbed Interactable Object to be a child of the grabbing object. More...
Public Member Functions | |
override bool | StartGrab (GameObject grabbingObject, GameObject givenGrabbedObject, Rigidbody givenControllerAttachPoint) |
The StartGrab method sets up the grab attach mechanic as soon as an Interactable Object is grabbed. It is also responsible for creating the joint on the grabbed object. More... | |
override void | StopGrab (bool applyGrabbingObjectVelocity) |
The StopGrab method ends the grab of the current Interactable Object and cleans up the state. More... | |
Protected Member Functions | |
override void | Initialise () |
virtual void | SnapObjectToGrabToController (GameObject grabbingObject, GameObject obj) |
Sets the grabbed Interactable Object to be a child of the grabbing object.
The Interactable Object will have 1:1 tracking of the grabbing object, however it will also have reduced collision detection and will be able to pass through other colliders.
Script Usage:
VRTK_ChildOfControllerGrabAttach
script on either:Grab Attach Mechanic Script
parameter to denote use of the grab mechanic. VRTK/Examples/023_Controller_ChildOfControllerOnGrab
uses this grab attach mechanic for the bow and the arrow.
|
protected |
|
protectedvirtual |
override bool VRTK.GrabAttachMechanics.VRTK_GrabByChild.StartGrab | ( | GameObject | grabbingObject, |
GameObject | givenGrabbedObject, | ||
Rigidbody | givenControllerAttachPoint | ||
) |
The StartGrab method sets up the grab attach mechanic as soon as an Interactable Object is grabbed. It is also responsible for creating the joint on the grabbed object.
grabbingObject | The GameObject that is doing the grabbing. |
givenGrabbedObject | The GameObject that is being grabbed. |
givenControllerAttachPoint | The point on the grabbing object that the grabbed object should be attached to after grab occurs. |
true
if the grab is successful, false
if the grab is unsuccessful.override void VRTK.GrabAttachMechanics.VRTK_GrabByChild.StopGrab | ( | bool | applyGrabbingObjectVelocity | ) |
The StopGrab method ends the grab of the current Interactable Object and cleans up the state.
applyGrabbingObjectVelocity | If true will apply the current velocity of the grabbing object to the grabbed object on release. |