Page Summary
-
The
TranslationControllerclass manages the movement of aBaseTransformableNodewithin an AR scene using drag gestures. -
It selects the
BaseTransformableNodewhen a drag gesture begins if it's not already selected and then manipulates its position. -
Developers can control the allowed plane types for translation using
getAllowedPlaneTypesandsetAllowedPlaneTypesmethods. -
It provides methods like
canStartTransformation,onContinueTransformation, andonEndTransformationto manage the transformation lifecycle. -
isTransformingindicates the current transformation state of the controlled node.
Manipulates the position of a BaseTransformableNode
using a DragGestureRecognizer
. If not selected, the BaseTransformableNode
will become selected
when the DragGesture
starts.
Public Constructors
Public Methods
| boolean | |
| EnumSet < Plane.Type > | getAllowedPlaneTypes
()
Gets a reference to the EnumSet that determines which types of ArCore Planes this
TranslationController is allowed to translate on.
|
| boolean | |
| void | |
| void | |
| void | |
| void | setAllowedPlaneTypes
( EnumSet
< Plane.Type
> allowedPlaneTypes)
Sets which types of ArCore Planes this TranslationController is allowed to translate on.
|
Inherited Methods
Public Constructors
public TranslationController ( BaseTransformableNode transformableNode, DragGestureRecognizer gestureRecognizer)
Parameters
| transformableNode |
|---|
| gestureRecognizer |
Public Methods
public boolean canStartTransformation ( DragGesture gesture)
Parameters
public EnumSet < Plane.Type > getAllowedPlaneTypes ()
Gets a reference to the EnumSet that determines which types of ArCore Planes this TranslationController is allowed to translate on.
public boolean isTransforming ()
public void onContinueTransformation ( DragGesture gesture)
Parameters
public void onEndTransformation ( DragGesture gesture)
Parameters
public void onUpdated ( Node node, FrameTime frameTime)
Notifies the listener that onUpdate(FrameTime)
was called.
Parameters
| node | the node that was updated |
|---|---|
| frameTime | provides time information for the current frame |
public void setAllowedPlaneTypes ( EnumSet < Plane.Type > allowedPlaneTypes)
Sets which types of ArCore Planes this TranslationController is allowed to translate on.

