Class ARTransformer
Grab transformer which supports translation, rotation and scaling while respecting the AR environment. This transformer constrains the interactable to the ARPlane during translation.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Transformers
Assembly: solution.dll
Syntax
[AddComponentMenu("XR/Transformers/AR Transformer", 11)]
[HelpURL("https://docs.unity.cn/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.Transformers.ARTransformer.html")]
public class ARTransformer : XRBaseGrabTransformer, IXRDropTransformer, IXRGrabTransformer
Remarks
Assumes that AR raycast hits are enabled in the corresponding IARInteractor.
Properties
| Name | Description |
|---|---|
| canProcessOnDrop | Whether this grab transformer opts-in to allowing Process(XRGrabInteractable, UpdatePhase, ref Pose, ref Vector3) to be called by Unity once more after the interactable is deselected by all interactors. |
| elasticBreakLimit | The break limit of the elastic ratio used when scaling the object. Returns to min/max range over time after scaling beyond this limit. |
| elasticity | Amount of over scale allowed after hitting min/max of range. |
| enableElasticBreakLimit | Whether to enable the elastic break limit when scaling the object beyond range. |
| maxScale | The maximum scale of the object. |
| minScale | The minimum scale of the object. |
| objectPlaneTranslationMode | Controls whether the grab interactable will be constrained vertically, horizontally, or free to move in all axes. |
| scaleSensitivity | Sensitivity to movement being translated into scale. |
| useInteractorOrientation | Controls whether the interactable will use the orientation of the interactor, or not. |
Methods
| Name | Description |
|---|---|
| OnDrop(XRGrabInteractable, DropEventArgs) | Called by Unity when the given Interactable is dropped (in other words, when exiting the Select state). This method won't be called until the Interactable is released by every Interactor. Use this to do any code deinitialization based on the interactable being dropped. |
| OnEnable() | See MonoBehaviour. |
| OnGrab(XRGrabInteractable) | Called by Unity when the given Interactable is grabbed (in other words, when entering the Select state). This method won't be called again until the Interactable is released by every Interactor. Use this to do any code initialization based on the first Interactor that selects the Interactable. |
| OnGrabCountChanged(XRGrabInteractable, Pose, Vector3) | Called by Unity each time the number of selections changes for the given Interactable while grabbed by at least one Interactor, including when it is first grabbed. Use this to do any code initialization based on each Interactor currently selecting the Interactable, for example computing the initial distance between both Interactors grabbing the object. |
| Process(XRGrabInteractable, UpdatePhase, ref Pose, ref Vector3) | Called by the linked Interactable to calculate the target pose and scale.
Modify the value of |