VRTK_AxisScaleGrabAction
extends VRTK_BaseGrabAction
Overview
The Axis Scale Grab Action provides a mechanism to scale objects when they are grabbed with a secondary controller.
Inspector Parameters
- Ungrab Distance: The distance the secondary controller must move away from the original grab position before the secondary controller auto ungrabs the object.
- Lock X Axis: If checked the current X Axis of the object won't be scaled
- Lock Y Axis: If checked the current Y Axis of the object won't be scaled
- Lock Z Axis: If checked the current Z Axis of the object won't be scaled
- Uniform Scaling: If checked all the axes will be scaled together (unless locked)
Class Methods
Initialise/5
public override void Initialise(VRTK_InteractableObject currentGrabbdObject, VRTK_InteractGrab currentPrimaryGrabbingObject, VRTK_InteractGrab currentSecondaryGrabbingObject, Transform primaryGrabPoint, Transform secondaryGrabPoint)
- Parameters
VRTK_InteractableObject currentGrabbdObject
- The Interactable Object script for the object currently being grabbed by the primary controller.VRTK_InteractGrab currentPrimaryGrabbingObject
- The Interact Grab script for the object that is associated with the primary controller.VRTK_InteractGrab currentSecondaryGrabbingObject
- The Interact Grab script for the object that is associated with the secondary controller.Transform primaryGrabPoint
- The point on the object where the primary controller initially grabbed the object.Transform secondaryGrabPoint
- The point on the object where the secondary controller initially grabbed the object.- Returns
- none
The Initalise method is used to set up the state of the secondary action when the object is initially grabbed by a secondary controller.
ProcessUpdate/0
public override void ProcessUpdate()
- Parameters
- none
- Returns
- none
The ProcessUpdate method runs in every Update on the Interactable Object whilst it is being grabbed by a secondary controller.
ProcessFixedUpdate/0
public override void ProcessFixedUpdate()
- Parameters
- none
- Returns
- none
The ProcessFixedUpdate method runs in every FixedUpdate on the Interactable Object whilst it is being grabbed by a secondary controller and performs the scaling action.
Example
VRTK/Examples/043_Controller_SecondaryControllerActions
demonstrates the ability to grab an object with one controller and scale it by grabbing and pulling with the second controller.
Updated less than a minute ago