AI-generated Key Takeaways
-
BaseTransformationControllermanipulates the scale, rotation, and translation of aBaseTransformableNodein response to gestures. -
It uses a
BaseGestureRecognizerto detect gestures like drag, pinch, and twist, and applies corresponding transformations to the node. -
Subclasses like
RotationController,ScaleController, andTranslationControllerhandle specific transformation types. -
Developers can extend this class to create custom transformation controllers by implementing abstract methods.
-
The controller provides methods to check the transformation status, enable/disable transformations, and access the associated node and gesture recognizer.
| Known Direct Subclasses |
Manipulates the transform properties (i.e. scale/rotation/translation) of a BaseTransformableNode by responding to Gestures via a BaseGestureRecognizer.
Example's include, changing the TransformableNode's Scale based on a Pinch Gesture.
Public Constructors
|
BaseTransformationController(BaseTransformableNode transformableNode, BaseGestureRecognizer<T> gestureRecognizer)
|
Public Methods
| T | |
| BaseTransformableNode | |
| boolean | |
| boolean | |
| void | |
| void | |
| void |
onFinished(T gesture)
|
| void |
onGestureStarted(T gesture)
|
| void |
onUpdated(T gesture)
|
| void |
onUpdated(Node node, FrameTime frameTime)
Notifies the listener that
onUpdate(FrameTime) was called. |
| void |
setEnabled(boolean enabled)
|
Protected Methods
| abstract boolean |
canStartTransformation(T gesture)
|
| abstract void |
onContinueTransformation(T gesture)
|
| abstract void |
onEndTransformation(T gesture)
|
Inherited Methods
Public Constructors
public BaseTransformationController (BaseTransformableNode transformableNode, BaseGestureRecognizer<T> gestureRecognizer)
Parameters
| transformableNode | |
|---|---|
| gestureRecognizer |
Public Methods
public T getActiveGesture ()
public boolean isEnabled ()
public boolean isTransforming ()
public void onActivated (Node node)
Notifies the listener that onActivate() was called.
Parameters
| node | the node that was activated |
|---|
public void onDeactivated (Node node)
Notifies the listener that onDeactivate() was called.
Parameters
| node | the node that was deactivated |
|---|
public void onFinished (T gesture)
Parameters
| gesture |
|---|
public void onGestureStarted (T gesture)
Parameters
| gesture |
|---|
public void onUpdated (T 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 setEnabled (boolean enabled)
Parameters
| enabled |
|---|
Protected Methods
protected abstract boolean canStartTransformation (T gesture)
Parameters
| gesture |
|---|
protected abstract void onContinueTransformation (T gesture)
Parameters
| gesture |
|---|
protected abstract void onEndTransformation (T gesture)
Parameters
| gesture |
|---|