public class
TransformableNode
Node that can be selected, translated, rotated, and scaled using gestures from TransformationSystem
.
Public Constructors
TransformableNode(TransformationSystem transformationSystem)
|
Public Methods
RotationController |
getRotationController()
Returns the controller that rotates this node using a twist gesture.
|
ScaleController |
getScaleController()
Returns the controller that scales this node using a pinch gesture.
|
TranslationController |
getTranslationController()
Returns the controller that translates this node using a drag gesture.
|
Inherited Methods
From class
com.google.ar.sceneform.ux.BaseTransformableNode
void |
addTransformationController(BaseTransformationController<?> transformationController)
|
TransformationSystem | |
boolean |
isSelected()
Returns true if this node is currently selected by the TransformationSystem.
|
boolean |
isTransforming()
Returns true if any of the transformation controllers are actively transforming this node.
|
void | |
void |
removeTransformationController(BaseTransformationController<?> transformationController)
|
boolean |
select()
Sets this as the selected node in the TransformationSystem if there is no currently selected
node or if the currently selected node is not actively being transformed.
|
From class
com.google.ar.sceneform.Node
void |
addLifecycleListener(Node.LifecycleListener lifecycleListener)
Adds a listener that will be called when node lifecycle events occur.
|
void |
addTransformChangedListener(Node.TransformChangedListener transformChangedListener)
Adds a listener that will be called when the node's transformation changes.
|
void |
callOnHierarchy(Consumer<Node> consumer)
Traverses the hierarchy and call a method on each node (including this node).
|
final boolean | |
Node |
findInHierarchy(Predicate<Node> condition)
Traverses the hierarchy to find the first node (including this node) that meets a condition.
|
final Vector3 |
getBack()
Gets the world-space back vector (+z) of this node.
|
CollisionShape |
getCollisionShape()
Gets the shape to use for collisions with this node.
|
final Vector3 |
getDown()
Gets the world-space down vector (-y) of this node.
|
final Vector3 |
getForward()
Gets the world-space forward vector (-z) of this node.
|
final Vector3 |
getLeft()
Gets the world-space left vector (-x) of this node.
|
Light |
getLight()
Gets the current light, which is mutable.
|
final Vector3 |
getLocalPosition()
Gets a copy of the nodes position relative to its parent (local-space).
|
final Quaternion |
getLocalRotation()
Gets a copy of the nodes rotation relative to its parent (local-space).
|
final Vector3 |
getLocalScale()
Gets a copy of the nodes scale relative to its parent (local-space).
|
final String |
getName()
Returns the name of the node.
|
final Node |
getParent()
Returns the parent of this node.
|
Renderable |
getRenderable()
Gets the renderable to display for this node.
|
final Vector3 |
getRight()
Gets the world-space right vector (+x) of this node.
|
final Scene |
getScene()
Returns the scene that this node is part of, null if it isn't part of any scene.
|
final Vector3 |
getUp()
Gets the world-space up vector (+y) of this node.
|
final Vector3 |
getWorldPosition()
Get a copy of the nodes world-space position.
|
final Quaternion |
getWorldRotation()
Gets a copy of the nodes world-space rotation.
|
final Vector3 |
getWorldScale()
Gets a copy of the nodes world-space scale.
|
final boolean |
isActive()
Returns true if the node is active.
|
final boolean |
isDescendantOf(NodeParent ancestor)
Checks whether the given node parent is an ancestor of this node recursively.
|
final boolean |
isEnabled()
Gets the enabled state of this node.
|
boolean |
isTopLevel()
Returns true if this node is top level.
|
final Vector3 |
localToWorldDirection(Vector3 direction)
Converts a direction from the local-space of this node to world-space.
|
final Vector3 | |
void |
onActivate()
Handles when this node becomes active.
|
final void |
onAddChild(Node child)
|
void |
onDeactivate()
Handles when this node becomes inactivate.
|
final void |
onRemoveChild(Node child)
|
boolean |
onTouchEvent(HitTestResult hitTestResult, MotionEvent motionEvent)
Handles when this node is touched.
|
void | |
void | |
void |
removeLifecycleListener(Node.LifecycleListener lifecycleListener)
Removes a listener that will be called when node lifecycle events occur.
|
void |
removeTransformChangedListener(Node.TransformChangedListener transformChangedListener)
Removes a listener that will be called when the node's transformation changes.
|
void |
setCollisionShape(CollisionShape collisionShape)
Sets the shape to used to detect collisions for this
Node . |
final void |
setEnabled(boolean enabled)
Sets the enabled state of this node.
|
void | |
void |
setLocalPosition(Vector3 position)
Sets the position of this node relative to its parent (local-space).
|
void |
setLocalRotation(Quaternion rotation)
Sets the rotation of this node relative to its parent (local-space).
|
void | |
final void |
setLookDirection(Vector3 lookDirection)
Sets the direction that the node is looking at in world-space.
|
final void |
setLookDirection(Vector3 lookDirection, Vector3 upDirection)
Sets the direction that the node is looking at in world-space.
|
final void | |
void |
setOnTapListener(Node.OnTapListener onTapListener)
Registers a callback to be invoked when this node is tapped.
|
void |
setOnTouchListener(Node.OnTouchListener onTouchListener)
Registers a callback to be invoked when a touch event is dispatched to this node.
|
void | |
void | |
void | |
void | |
void | |
String |
toString()
|
final Vector3 |
worldToLocalDirection(Vector3 direction)
Converts a direction from world-space to the local-space of this node.
|
final Vector3 |
From class
com.google.ar.sceneform.NodeParent
final void | |
void | |
boolean | |
Node | |
Node |
findInHierarchy(Predicate<Node> condition)
Traverse the hierarchy to find the first node that meets a condition.
|
final List<Node> |
getChildren()
Returns an immutable list of this parent's children.
|
void |
onAddChild(Node child)
|
void |
onRemoveChild(Node child)
|
final void |
From class
java.lang.Object
From interface
com.google.ar.sceneform.Node.OnTapListener
abstract void |
Public Constructors
public TransformableNode (TransformationSystem transformationSystem)
Parameters
transformationSystem |
---|
Public Methods
public RotationController getRotationController ()
Returns the controller that rotates this node using a twist gesture.
public ScaleController getScaleController ()
Returns the controller that scales this node using a pinch gesture.
public TranslationController getTranslationController ()
Returns the controller that translates this node using a drag gesture.