TranslationController

  • The TranslationController class manages the movement of a BaseTransformableNode within an AR scene using drag gestures.

  • It selects the BaseTransformableNode when 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 getAllowedPlaneTypes and setAllowedPlaneTypes methods.

  • It provides methods like canStartTransformation , onContinueTransformation , and onEndTransformation to manage the transformation lifecycle.

  • isTransforming indicates the current transformation state of the controlled node.

public class TranslationController

Manipulates the position of a BaseTransformableNode using a DragGestureRecognizer . If not selected, the BaseTransformableNode will become selected when the DragGesture starts.

Public Constructors

TranslationController ( BaseTransformableNode transformableNode, DragGestureRecognizer gestureRecognizer)

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
onUpdated ( Node node, FrameTime frameTime)
Notifies the listener that onUpdate(FrameTime) was called.
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
gesture

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
gesture

public void onEndTransformation ( DragGesture gesture)

Parameters
gesture

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.

Parameters
allowedPlaneTypes
Design a Mobile Site
View Site in Mobile | Classic
Share by: