Class XRSingleGrabFreeTransformer
Grab transformer which supports moving and rotating unconstrained with a single Interactor. Maintains the offset from the attachment point used for that Interactor. This is the default grab transformer used for single selections.
Inheritance
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Transformers
Syntax
[AddComponentMenu("XR/Transformers/XR Single Grab Free Transformer", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.3/api/UnityEngine.XR.Interaction.Toolkit.Transformers.XRSingleGrabFreeTransformer.html")]
public class XRSingleGrabFreeTransformer : XRBaseGrabTransformer, IXRGrabTransformer
Methods
Process(XRGrabInteractable, XRInteractionUpdateOrder.UpdatePhase, ref Pose, ref Vector3)
Called by the linked Interactable to calculate the target pose and scale.
Modify the value of targetPose
and/or localScale
(or neither).
Declaration
public override void Process(XRGrabInteractable grabInteractable, XRInteractionUpdateOrder.UpdatePhase updatePhase, ref Pose targetPose, ref Vector3 localScale)
Parameters
Type | Name | Description |
---|---|---|
XRGrabInteractable | grabInteractable | The XR Grab Interactable to calculate the target pose and scale for. |
XRInteractionUpdateOrder.UpdatePhase | updatePhase | The update phase this is called during. |
Pose | targetPose | The target pose for the current frame. |
Vector3 | localScale | The scale of the Interactable's transform relative to the GameObjects parent. |
Overrides
Remarks
When there is more than one linked grab transformer that can process, the updated value of each ref parameter
is passed to each in series according to its order in the list. You can utilize this by, for example,
having the first grab transformer compute the target pose, and the second compute just the scale.
if (grabInteractable.interactorsSelecting.Count < 2) return;