Page Summary
-
TransformationSystemmanages the selection and transformation ofBaseTransformableNodeobjects in a Sceneform scene. -
It uses gesture recognizers to detect user interactions like dragging, pinching, and twisting.
-
The
onTouchmethod must be called to process touch events and trigger gesture recognition, typically handled byArFragment. -
A
SelectionVisualizeris used to highlight the currently selected node for user feedback. -
Developers can add custom gesture recognizers to extend the system's capabilities.
Coordinates which BaseTransformableNode
is currently selected. Also, detects various
gestures used by the transformation controls of BaseTransformableNode
.
onTouch(HitTestResult, MotionEvent)
must be called for gestures to be detected. By
default, this is done automatically by ArFragment
.
Public Constructors
Public Methods
| void | addGestureRecognizer
( BaseGestureRecognizer
<?> gestureRecognizer)
Adds a gesture recognizer to this transformation system.
|
| DragGestureRecognizer | getDragRecognizer
()
Gets the gesture recognizer for determining when the user performs a drag motion on the touch
screen.
|
| GesturePointersUtility | getGesturePointersUtility
()
Gets the utility used by
BaseGestureRecognizer
subclasses to retain/release pointer Ids
so that each pointer can only be used in one gesture at a time. |
| PinchGestureRecognizer | getPinchRecognizer
()
Gets the gesture recognizer for determining when the user performs a two-finger pinch motion on
the touch screen.
|
| BaseTransformableNode | |
| SelectionVisualizer | |
| TwistGestureRecognizer | getTwistRecognizer
()
Gets the gesture recognizer for determining when the user performs a two-finger twist motion on
the touch screen.
|
| void | onTouch
( HitTestResult
hitTestResult, MotionEvent
motionEvent)
Dispatches touch events to the gesture recognizers contained by this transformation system.
|
| boolean | selectNode
( BaseTransformableNode
node)
Sets a
BaseTransformableNode
as the selected node if there is no currently selected
node or if the currently selected node is not actively being transformed. |
| void |
Inherited Methods
Public Constructors
public TransformationSystem ( DisplayMetrics displayMetrics, SelectionVisualizer selectionVisualizer)
Parameters
| displayMetrics |
|---|
| selectionVisualizer |
Public Methods
public void addGestureRecognizer ( BaseGestureRecognizer <?> gestureRecognizer)
Adds a gesture recognizer to this transformation system. Touch events will be dispatched to the
recognizer when onTouch(HitTestResult, MotionEvent)
is called.
Parameters
public DragGestureRecognizer getDragRecognizer ()
Gets the gesture recognizer for determining when the user performs a drag motion on the touch screen.
public GesturePointersUtility getGesturePointersUtility ()
Gets the utility used by BaseGestureRecognizer
subclasses to retain/release pointer Ids
so that each pointer can only be used in one gesture at a time.
public PinchGestureRecognizer getPinchRecognizer ()
Gets the gesture recognizer for determining when the user performs a two-finger pinch motion on the touch screen.
public BaseTransformableNode getSelectedNode ()
Gets the currently selected node. Only the currently selected node can be transformed. Nodes are selected automatically when they are tapped, or when the user begins to translate the node with a drag gesture.
public SelectionVisualizer getSelectionVisualizer ()
Gets the selection visualizer used to visualize which BaseTransformableNode
is
currently selected.
public TwistGestureRecognizer getTwistRecognizer ()
Gets the gesture recognizer for determining when the user performs a two-finger twist motion on the touch screen.
public void onTouch ( HitTestResult hitTestResult, MotionEvent motionEvent)
Dispatches touch events to the gesture recognizers contained by this transformation system.
Parameters
| hitTestResult |
|---|
| motionEvent |
public boolean selectNode ( BaseTransformableNode node)
Sets a BaseTransformableNode
as the selected node if there is no currently selected
node or if the currently selected node is not actively being transformed. If null, then
deselects the currently selected node if the node is not transforming.
Parameters
Returns
- true if the node was successfully selected
See Also
public void setSelectionVisualizer ( SelectionVisualizer selectionVisualizer)
Sets the selection visualizer used to visualize which BaseTransformableNode
is
currently selected. If there is already a selected node, then the old selection visual is
removed and the new one is applied immediately.

