Class ARTranslationInteractable
Manipulates the position of an object via a drag gesture. If not selected, the object will be selected when the drag gesture starts.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.AR
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("XR/AR Translation Interactable", 22)]
[RequireComponent(typeof(ARSelectionInteractable))]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.5/api/UnityEngine.XR.Interaction.Toolkit.AR.ARTranslationInteractable.html")]
public class ARTranslationInteractable : ARBaseGestureInteractable, IXRActivateInteractable, IXRHoverInteractable, IXRSelectInteractable, IXRFocusInteractable, IXRInteractionStrengthInteractable, IXRInteractable, IXROverridesGazeAutoSelect
Properties
fallbackLayerMask
The LayerMask that Unity uses during an additional ray cast when a user touch does not hit any AR trackable planes.
Declaration
public LayerMask fallbackLayerMask { get; set; }
Property Value
Type | Description |
---|---|
LayerMask |
maxTranslationDistance
The maximum translation distance of this object.
Declaration
public float maxTranslationDistance { get; set; }
Property Value
Type | Description |
---|---|
float |
objectGestureTranslationMode
Controls whether the object will be constrained vertically, horizontally, or free to move in all axis.
Declaration
public GestureTransformationUtility.GestureTranslationMode objectGestureTranslationMode { get; set; }
Property Value
Type | Description |
---|---|
GestureTransformationUtility.GestureTranslationMode |
Methods
CanStartManipulationForGesture(DragGesture)
Determines if the manipulation can start for the given gesture.
Declaration
protected override bool CanStartManipulationForGesture(DragGesture gesture)
Parameters
Type | Name | Description |
---|---|---|
DragGesture | gesture | The current gesture. |
Returns
Type | Description |
---|---|
bool | Returns true if the manipulation can start. Otherwise, returns false. |
Overrides
OnContinueManipulation(DragGesture)
Unity calls this method automatically when the manipulation continues.
Declaration
protected override void OnContinueManipulation(DragGesture gesture)
Parameters
Type | Name | Description |
---|---|---|
DragGesture | gesture | The current gesture. |
Overrides
See Also
OnEndManipulation(DragGesture)
Unity calls this method automatically when the manipulation ends.
Declaration
protected override void OnEndManipulation(DragGesture gesture)
Parameters
Type | Name | Description |
---|---|---|
DragGesture | gesture | The current gesture. |
Overrides
See Also
OnStartManipulation(DragGesture)
Unity calls this method automatically when the manipulation starts.
Declaration
protected override void OnStartManipulation(DragGesture gesture)
Parameters
Type | Name | Description |
---|---|---|
DragGesture | gesture | The current gesture. |
Overrides
See Also
ProcessInteractable(UpdatePhase)
The XRInteractionManager calls this method to update the Interactable.
Declaration
public override void ProcessInteractable(XRInteractionUpdateOrder.UpdatePhase updatePhase)
Parameters
Type | Name | Description |
---|---|---|
XRInteractionUpdateOrder.UpdatePhase | updatePhase | The update phase this is called during. |
Overrides
Remarks
Please see the XRInteractionManager and XRInteractionUpdateOrder.UpdatePhase documentation for more details on update order.