Package pro.streem.ar.sceneform.ux
Class TransformationSystem
- java.lang.Object
-
- pro.streem.ar.sceneform.ux.TransformationSystem
-
public class TransformationSystem extends java.lang.ObjectCoordinates whichBaseTransformableNodeis currently selected. Also, detects various gestures used by the transformation controls ofBaseTransformableNode.onTouch(HitTestResult, MotionEvent)must be called for gestures to be detected. By default, this is done automatically byArFragment.
-
-
Constructor Summary
Constructors Constructor Description TransformationSystem(android.util.DisplayMetrics displayMetrics, SelectionVisualizer selectionVisualizer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddGestureRecognizer(BaseGestureRecognizer<?> gestureRecognizer)Adds a gesture recognizer to this transformation system.DragGestureRecognizergetDragRecognizer()Gets the gesture recognizer for determining when the user performs a drag motion on the touch screen.GesturePointersUtilitygetGesturePointersUtility()Gets the utility used byBaseGestureRecognizersubclasses to retain/release pointer Ids so that each pointer can only be used in one gesture at a time.PinchGestureRecognizergetPinchRecognizer()Gets the gesture recognizer for determining when the user performs a two-finger pinch motion on the touch screen.BaseTransformableNodegetSelectedNode()Gets the currently selected node.SelectionVisualizergetSelectionVisualizer()Gets the selection visualizer used to visualize whichBaseTransformableNodeis currently selected.TwistGestureRecognizergetTwistRecognizer()Gets the gesture recognizer for determining when the user performs a two-finger twist motion on the touch screen.voidonTouch(pro.streem.ar.sceneform.HitTestResult hitTestResult, android.view.MotionEvent motionEvent)Dispatches touch events to the gesture recognizers contained by this transformation system.booleanselectNode(BaseTransformableNode node)Sets aBaseTransformableNodeas the selected node if there is no currently selected node or if the currently selected node is not actively being transformed.voidsetSelectionVisualizer(SelectionVisualizer selectionVisualizer)Sets the selection visualizer used to visualize whichBaseTransformableNodeis currently selected.
-
-
-
Constructor Detail
-
TransformationSystem
public TransformationSystem(android.util.DisplayMetrics displayMetrics, SelectionVisualizer selectionVisualizer)
-
-
Method Detail
-
setSelectionVisualizer
public void setSelectionVisualizer(SelectionVisualizer selectionVisualizer)
Sets the selection visualizer used to visualize whichBaseTransformableNodeis currently selected. If there is already a selected node, then the old selection visual is removed and the new one is applied immediately.
-
getSelectionVisualizer
public SelectionVisualizer getSelectionVisualizer()
Gets the selection visualizer used to visualize whichBaseTransformableNodeis currently selected.
-
getGesturePointersUtility
public GesturePointersUtility getGesturePointersUtility()
Gets the utility used byBaseGestureRecognizersubclasses to retain/release pointer Ids so that each pointer can only be used in one gesture at a time.
-
getDragRecognizer
public DragGestureRecognizer getDragRecognizer()
Gets the gesture recognizer for determining when the user performs a drag motion on the touch screen.
-
getPinchRecognizer
public PinchGestureRecognizer getPinchRecognizer()
Gets the gesture recognizer for determining when the user performs a two-finger pinch motion on the touch screen.
-
getTwistRecognizer
public TwistGestureRecognizer getTwistRecognizer()
Gets the gesture recognizer for determining when the user performs a two-finger twist motion on the touch screen.
-
addGestureRecognizer
public void addGestureRecognizer(BaseGestureRecognizer<?> gestureRecognizer)
Adds a gesture recognizer to this transformation system. Touch events will be dispatched to the recognizer whenonTouch(HitTestResult, MotionEvent)is called.
-
getSelectedNode
@Nullable 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.
-
selectNode
public boolean selectNode(@Nullable BaseTransformableNode node)Sets aBaseTransformableNodeas 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.- Returns:
- true if the node was successfully selected
- See Also:
BaseTransformableNode.isTransforming()
-
onTouch
public void onTouch(pro.streem.ar.sceneform.HitTestResult hitTestResult, android.view.MotionEvent motionEvent)Dispatches touch events to the gesture recognizers contained by this transformation system.
-
-