Most visited

Recently visited

Node

public class Node
extends Object

java.lang.Object
   ↳ com.viro.core.Node
Known Direct Subclasses
ARNode ARNode is a specialized Node that corresponds to a detected or manually created ARAnchor
Object3D Object3D defines a Node that can load FBX, OBJ, GLTF, or GLB models. 
Portal Portal is a special Node that serves as an entry or window into an associated PortalScene
PortalScene PortalScene is the root of the subgraph of Nodes that is displayed through a Portal


Underlying each Scene is a full-featured 3D scene graph engine. A scene graph is a hierarchical tree structure of nodes that allows developers to intuitively construct a 3D environment. The root node is retrieved via getRootNode(). Sub-nodes are represented by child Node objects. Each Node represents a position and transform in 3D space, to which you can attach 3D objects, lights, or other content.

A Node by itself has no visible content when it is rendered; it represents only a coordinate space transform (position, rotation, and scale) relative to its parent Node. You use a hierarchy of Node objects to model your scene in a way that makes sense for your application.

To take a concrete example, suppose your app presents an animated view of a solar system. You can construct a Node hierarchy that models the sun, planets, and moons relative to one another. Each body can be a Node, with its position in its orbit defined in the coordinate system of its parent. The sun would define its own coordinate space, and the Earth would position itself in that space. At the same time, the Earth would define its own coordinate space in which the moon would position itself, and so on.

Nodes are also responsible for event handling. Events are triggered either programmatically, or by an input Controller action. Events start at the "hovered" (or focused) Node. If that Node cannot respond to the event (e.g. if it does not have the appropriate listener installed), the event will bubble up the scene graph to that Node's parent, and so on, until a Node that can handle the event is found.

All events are also received by the Controller, which provides a centralized place to respond to all events regardless of what Nodes they targeted.

For an extended discussion of Nodes, refer to the Scene Guide.

Summary

Nested classes

enum Node.DragType

Specifies the behavior of dragging if the Node has an attached DragListener

class Node.NodeBuilder<R extends Node, B extends NodeBuilder<R, B>>

NodeBuilder for creating Node objects. 

enum Node.TransformBehavior

TransformBehaviors change the way a Node computes its position, rotation and scale. 

interface Node.TransformListener

The TransformListener receives callbacks when the Node's position has changed. 

Public constructors

Node()

Construct a new Node centered at the origin, with no geometry.

Public methods

void addChildNode(Node childNode)

Add a child Node to this Node.

void addLight(Light light)

Add the given Light to this Node.

void addSound(SpatialSound sound)

Add the given SpatialSound to this Node.

static NodeBuilder<? extends Node, ? extends NodeBuilder> builder()

Creates a builder for building complex Node objects.

void clearPhysicsBody()

Clear the PhysicsBody of this Node.

Vector convertLocalPositionToWorldSpace(Vector localPosition)

Convert the given position from the coordinate space of this Node into the world coordinate system.

Vector convertWorldPositionToLocalSpace(Vector worldPosition)

Convert the given position from world coordinates into the coordinate space of this Node.

void dispose()

Release native resources associated with this Node.

Animation getAnimation(String key)

Get the Animation associated with this Node or its children with the given key.

Set<String> getAnimationKeys()

Get the names of the animations available to run on this Node or any of its children.

BoundingBox getBoundingBox()

Get the BoundingBox of this Node.

Camera getCamera()

Get the Camera attached to this Node.

List<Node> getChildNodes()

Get the children of this Node in the scene-graph.

ClickListener getClickListener()

Get the ClickListener that is currently installed for this Node.

DragListener getDragListener()

Get the DragListener that is currently installed for this Node.

float getDragMaxDistance()

Get the maximum distance this Node can be dragged along the user-specified plane when drag type is set to FIXED_TO_PLANE.

Vector getDragPlaneNormal()

Get the normal vector that (along with the point) defines the plane used for FIXED_TO_PLANE

Vector getDragPlanePoint()

Get the point that (along with the normal vector) defines the plane used for FIXED_TO_PLANE.

Node.DragType getDragType()

Get the dragging behavior for this Node.

FixedParticleEmitter getFixedParticleEmitter()

Return the FixedParticleEmitter attached to this Node, if any.

FuseListener getFuseListener()

Get the FuseListener that is currently installed for this Node.

Geometry getGeometry()

Get the Geometry attached to this Node.

GesturePinchListener getGesturePinchListener()

Get the GesturePinchListener that is currently installed for this Node.

GestureRotateListener getGestureRotateListener()

Get the GestureRotateListener that is currently installed for this Node.

boolean getHighAccuracyEvents()

Returns true if high accuracy events are enabled.

boolean getHighAccuracyGaze()

This method is deprecated. Use getHighAccuracyEvents()

HoverListener getHoverListener()

Get the HoverListener that is currently installed for this Node.

boolean getIgnoreEventHandling()

Returns true if this Node is currently set to ignore event handling.

int getLightReceivingBitMask()

Get the light receiving bit mask, which determines which lights will illuminate this Node.

List<Light> getLights()

Get all Lights that have been added to this Node.

String getName()

Get the name that can be optionally used to represent this Node.

float getOpacity()

Get the opacity of this Node.

Node getParentNode()

Get the parent of this Node in the scene-graph.

PortalScene getParentPortalScene()

Get the nearest PortalScene that is an ancestor of this Node.

ParticleEmitter getParticleEmitter()

Return the ParticleEmitter attached to this Node, if any.

PhysicsBody getPhysicsBody()

Get the PhysicsBody associated with this Node.

Vector getPositionRealtime()

Get the real-time local position of this Node.

int getRenderingOrder()

Get the rendering order of this Node.

Vector getRotationEulerRealtime()

Get the real-time local orientation of this Node, expressed as three Euler angles.

Vector getRotationPivot()

Get the rotation pivot of this Node.

Quaternion getRotationQuaternionRealtime()

Get the real-time orientation of this Node, expressed as a Quaternion.

Vector getScalePivot()

Get the scale pivot of this Node.

Vector getScaleRealtime()

Get the real-time scale of this Node.

int getShadowCastingBitMask()

Get the shadow casting bit mask, which determines for which lights this Node will cast shadows.

List<SpatialSound> getSounds()

Get all SpatialSounds that have been added to this Node.

String getTag()

Return the tag for this Node.

TouchpadScrollListener getTouchpadScrollListener()

Get the TouchpadScrollListener that is currently installed for this Node.

TouchpadSwipeListener getTouchpadSwipeListener()

Get the TouchpadSwipeListener that is currently installed for this Node.

TouchpadTouchListener getTouchpadTouchListener()

Get the TouchpadTouchListener that is currently installed for this Node.

EnumSet<Node.TransformBehavior> getTransformBehaviors()

Return the Node.TransformBehaviors used by this Node.

Matrix getWorldTransformRealTime()

Get the real-time world transform of this Node.

boolean hasPhysics()

Return true if this Node has a PhysicsBody attached, meaning its participates in the physics simulation.

PhysicsBody initPhysicsBody(PhysicsBody.RigidBodyType rigidBodyType, float mass, PhysicsShape shape)

Create a PhysicsBody for this Node, which makes the Node participate in the physics simulation.

boolean isVisible()

Return true if this Node's visible property is true.

void removeAllChildNodes()

Remove all children from this Node.

void removeAllLights()

Remove all Lights from this Node.

void removeAllSounds()

Remove all SpatialSounds from this Node.

void removeFixedParticleEmitter()

Removes any attached FixedParticleEmitter from this Node.

void removeFromParentNode()

Remove this Node from its parent.

void removeLight(Light light)

Remove the given Light from this Node.

void removeParticleEmitter()

Removes any attached ParticleEmitter from this Node.

void removeSound(SpatialSound sound)

Remove the given SpatialSound from this Node.

void removeTransformListener()

Remove any Node.TransformListener that is currently attached to this Node.

void setCamera(Camera camera)

Attach the given Camera to this Node.

void setClickListener(ClickListener listener)

Set a ClickListener to respond when users click with their Controller on this Node.

void setDragListener(DragListener listener)

Set the DragListener to respond when a user attempts to drag this Node by pressing over it and moving the Controller.

void setDragMaxDistance(float maxDistance)

Set the maximum distance this Node can be dragged along the user-specified plane when drag type is set to FIXED_TO_PLANE.

void setDragPlaneNormal(Vector planeNormal)

Specify the normal vector that (along with the point) defines the plane to use when dragging is set to FIXED_TO_PLANE.

void setDragPlanePoint(Vector planePoint)

Specify the point that (along with the normal vector) defines the plane to use when dragging is set to FIXED_TO_PLANE.

void setDragType(Node.DragType dragType)

Set the behavior of dragging if this Node has an attached DragListener.

void setFixedParticleEmitter(FixedParticleEmitter emitter)

Set the FixedParticleEmitter to use for this Node.

void setFuseListener(FuseListener listener)

Set the FuseListener to respond when a user hovers over this Node for setTimeToFuse(float) milliseconds.

void setGeometry(Geometry geometry)

Set the Geometry of this Node.

void setGesturePinchListener(GesturePinchListener listener)

Set the GesturePinchListener to respond when a user pinches with two fingers over this Node using a screen Controller.

void setGestureRotateListener(GestureRotateListener listener)

Set the GestureRotateListener to respond when a user rotates with two fingers over this Node using a screen Controller.

void setHighAccuracyEvents(boolean highAccuracyEvents)

True if events should use the Geometry of this Node to determine if the user is interacting with this Node.

void setHighAccuracyGaze(boolean highAccuracyGaze)

This method is deprecated. Use setHighAccuracyEvents(boolean)

void setHoverListener(HoverListener listener)

Set the HoverListener to respond when users hover over this Node.

void setIgnoreEventHandling(boolean ignore)

When set to true, this Node will ignore events and not prevent Nodes behind it from receiving event callbacks.

void setLightReceivingBitMask(int bitMask)

Set the bit mask that determines what lights will illuminate this Node.

void setName(String name)

Set a name to represent this Node.

void setOpacity(float opacity)

Set the opacity of this Node.

void setParticleEmitter(ParticleEmitter emitter)

Set the ParticleEmitter to use for this Node.

void setPosition(Vector position)

Set the position of this Node.

void setRenderingOrder(int renderingOrder)

Set the rendering order of this Node.

void setRotation(Quaternion rotation)

Set the orientation of this Node, expressed as a Quaternion.

void setRotation(Vector rotation)

Set the orientation of this Node, expressed as three Euler angles in a Vector.

void setRotationPivot(Vector pivot)

Set the point on the Node about which rotation will occur.

void setScale(Vector scale)

Set the scale of this node as a Vector.

void setScalePivot(Vector pivot)

Set the point on the Node around which scaling will occur.

void setShadowCastingBitMask(int bitMask)

Set the bit mask that determines for which lights the contents of this Node will cast shadows.

void setTag(String tag)

Set the tag for this Node.

void setTimeToFuse(float millis)

Set the time in milliseconds the user must hover over a Node before a Fuse event is triggered on an installed FuseListener.

void setTouchpadScrollListener(TouchpadScrollListener listener)

Set the TouchpadScrollListener to respond when a user scrolls a touchpad while hovering over a Node.

void setTouchpadSwipeListener(TouchpadSwipeListener listener)

Set the TouchpadSwipeListener to respond when a user swipes across a touchpad Controller while hovering over this Node.

void setTouchpadTouchListener(TouchpadTouchListener listener)

Set the TouchpadTouchListener to respond when a user touches or moves across a touchpad Controller while hovering over this Node.

void setTransformBehaviors(EnumSet<Node.TransformBehavior> transformBehaviors)

Set the Node.TransformBehaviors to use for this Node.

void setTransformListener(Node.TransformListener transformListener, double distanceFilter)

Set the Node.TransformListener for this Node.

void setVisible(boolean visible)

Set to false to hide this Node, and all of its children.

Public constructors

Node

Node ()

Construct a new Node centered at the origin, with no geometry.

Public methods

addChildNode

void addChildNode (Node childNode)

Add a child Node to this Node. The child will exist in the coordinate space of this Node (that is, it inherits the rotation, scale, and position of its parent, and applies its own rotation, scale, and position).

Parameters
childNode Node: The Node to add as a child.

addLight

void addLight (Light light)

Add the given Light to this Node. The Light will illuminate all objects in the Scene that fall within its area of influence. As a child of this Node, the Light will also receive all the Node's transforms.

Parameters
light Light: The Light to add to this Node.

addSound

void addSound (SpatialSound sound)

Add the given SpatialSound to this Node. As a child of this Node, the SpatialSound will also receive all the Node's transforms.

Parameters
sound SpatialSound: The SpatialSound to add to this Node.

builder

NodeBuilder<? extends Node, ? extends NodeBuilder> builder ()

Creates a builder for building complex Node objects.

Returns
NodeBuilder<? extends Node, ? extends NodeBuilder> Node.NodeBuilder object.

clearPhysicsBody

void clearPhysicsBody ()

Clear the PhysicsBody of this Node. This will stop the Node from participating in the physics simulation.

convertLocalPositionToWorldSpace

Vector convertLocalPositionToWorldSpace (Vector localPosition)

Convert the given position from the coordinate space of this Node into the world coordinate system. This Node's coordinate system is the coordinate system in which the children of this Node are positioned. The world coordinate system is the global coordinate space; e.g., the coordinate space of the Scene's root Node.

Parameters
localPosition Vector: The local position to convert.

Returns
Vector The position in world space.

convertWorldPositionToLocalSpace

Vector convertWorldPositionToLocalSpace (Vector worldPosition)

Convert the given position from world coordinates into the coordinate space of this Node. The world coordinate system is the global coordinate space; e.g., the coordinate space of the Scene's root Node. This Node's coordinate system is the coordinate system in which the children of this Node are positioned.

Parameters
worldPosition Vector: The world position to convert.

Returns
Vector The position in local space.

dispose

void dispose ()

Release native resources associated with this Node.

getAnimation

Animation getAnimation (String key)

Get the Animation associated with this Node or its children with the given key. Returns null if no Animation could be found with the specified key. The Animation returned here is new, and not cached. It can be freshly configured (e.g. by setting its looping and delay parameters) and then executed.

To see all available Animations on this Node, use getAnimationKeys().

Parameters
key String: The name of the Animation.

Returns
Animation The Animation found, or null if none found.

getAnimationKeys

Set<String> getAnimationKeys ()

Get the names of the animations available to run on this Node or any of its children. If this Node represents a scene loaded from a 3D file format like FBX, then the returned Set will contain the names of all skeletal and keyframe animations that were installed.

Returns
Set<String> The names of each animation in this Node.

getBoundingBox

BoundingBox getBoundingBox ()

Get the BoundingBox of this Node. This bounding box encompasses this Node's geometry and the bounds of all of this Node's children.

Returns
BoundingBox The BoundingBox of this Node.

getCamera

Camera getCamera ()

Get the Camera attached to this Node.

Returns
Camera The Camera, or null if none is attached.

getChildNodes

List<Node> getChildNodes ()

Get the children of this Node in the scene-graph.

Returns
List<Node> The children.

getClickListener

ClickListener getClickListener ()

Get the ClickListener that is currently installed for this Node.

Returns
ClickListener The installed listener, or null if none is installed.

getDragListener

DragListener getDragListener ()

Get the DragListener that is currently installed for this Node.

Returns
DragListener The installed listener, or null if none is installed.

getDragMaxDistance

float getDragMaxDistance ()

Get the maximum distance this Node can be dragged along the user-specified plane when drag type is set to FIXED_TO_PLANE.

Returns
float The maximum drag distance from the camera.

getDragPlaneNormal

Vector getDragPlaneNormal ()

Get the normal vector that (along with the point) defines the plane used for FIXED_TO_PLANE

Returns
Vector The Vector specifying the plane's normal.

getDragPlanePoint

Vector getDragPlanePoint ()

Get the point that (along with the normal vector) defines the plane used for FIXED_TO_PLANE. This point is given in world coordinates.

Returns
Vector The Vector specifying the point in world coordinates.

getDragType

Node.DragType getDragType ()

Get the dragging behavior for this Node.

Returns
Node.DragType The Node.DragType for this Node.

getFixedParticleEmitter

FixedParticleEmitter getFixedParticleEmitter ()

Return the FixedParticleEmitter attached to this Node, if any.

Returns
FixedParticleEmitter The FixedParticleEmitter, or null if none is attached.

getFuseListener

FuseListener getFuseListener ()

Get the FuseListener that is currently installed for this Node.

Returns
FuseListener The installed listener, or null if none is installed.

getGeometry

Geometry getGeometry ()

Get the Geometry attached to this Node. Geometries are the actual 3D objects that are rendered for each Node.

Returns
Geometry The Geometry attached to this Node, or null if no Geometry is attached.

getGesturePinchListener

GesturePinchListener getGesturePinchListener ()

Get the GesturePinchListener that is currently installed for this Node.

Returns
GesturePinchListener The installed listener, or null if none is installed.

getGestureRotateListener

GestureRotateListener getGestureRotateListener ()

Get the GestureRotateListener that is currently installed for this Node.

Returns
GestureRotateListener The installed listener, or null if none is installed.

getHighAccuracyEvents

boolean getHighAccuracyEvents ()

Returns true if high accuracy events are enabled.

Returns
boolean True if this Node is using high accuracy events.

getHighAccuracyGaze

boolean getHighAccuracyGaze ()

This method is deprecated.
Use getHighAccuracyEvents()

Returns true if high accuracy gaze is enabled.

Returns
boolean True if this Node is using high accuracy gazing.

getHoverListener

HoverListener getHoverListener ()

Get the HoverListener that is currently installed for this Node.

Returns
HoverListener The installed listener, or null if none is installed.

getIgnoreEventHandling

boolean getIgnoreEventHandling ()

Returns true if this Node is currently set to ignore event handling.

Returns
boolean True if this Node is ignoring event handling.

getLightReceivingBitMask

int getLightReceivingBitMask ()

Get the light receiving bit mask, which determines which lights will illuminate this Node.

Returns
int The bit mask.

getLights

List<Light> getLights ()

Get all Lights that have been added to this Node.

Returns
List<Light> List of all the Lights in this Node.

getName

String getName ()

Get the name that can be optionally used to represent this Node. Names are user-specified and are not used internally by Viro.

Returns
String name The name used by this Node.

getOpacity

float getOpacity ()

Get the opacity of this Node. A value of 0.0 means the contents fo the Node are fully transparent, and a value of 1.0 means the contents of the Node are fully opaque.

Returns
float The opacity from 0.0 to 1.0.

getParentNode

Node getParentNode ()

Get the parent of this Node in the scene-graph. Returns null if this Node has no parent.

Returns
Node The parent Node.

getParentPortalScene

PortalScene getParentPortalScene ()

Get the nearest PortalScene that is an ancestor of this Node. Returns null if this is the root node.

Returns
PortalScene The nearest ancestor PortalScene.

getParticleEmitter

ParticleEmitter getParticleEmitter ()

Return the ParticleEmitter attached to this Node, if any.

Returns
ParticleEmitter The ParticleEmitter, or null if none is attached.

getPhysicsBody

PhysicsBody getPhysicsBody ()

Get the PhysicsBody associated with this Node. The PhysicsBody can be used to tune the way in which this Node responds to other physics bodies, global forces, and collisions. Returns null if this Node is not participating in the physics simulation. To activate physics for a node, use initPhysicsBody(PhysicsBody.RigidBodyType, float, PhysicsShape).

Returns
PhysicsBody The PhysicsBody associated with this Node.

getPositionRealtime

Vector getPositionRealtime ()

Get the real-time local position of this Node. The local position is the Node's location in the coordinate system of its parent. The position returned is real-time in that it is the position the Node currently appears on-screen. Note this may not match the value last set by setPosition(Vector) because the real-time position is influenced by many factors: animation, the physics simulation, and more.

Returns
Vector The real-time position as a Vector.

getRenderingOrder

int getRenderingOrder ()

Get the rendering order of this Node. The rendering order determines the order in which this Node is rendered relative to other Nodes.

Returns
int The rendering order, as an int.

getRotationEulerRealtime

Vector getRotationEulerRealtime ()

Get the real-time local orientation of this Node, expressed as three Euler angles. Specifically, the X component is rotation about the X axis (pitch), the Y component is rotation about the node's Y axis (yaw), and Z is the rotation around the node's Z axis (roll). This returns the real-time orientation, meaning the orientation of the Node as it currently appears on-screen.

Note this may not match the value last set by setRotation(Vector) because the real-time rotation is influenced by many factors: animation, the physics simulation, and more.

The returned orientation is the Node's local orientation (its orientation with respect to its parent). It does not take into the account the orientation of parent Nodes.

Returns
Vector The rotation in Euler form.

getRotationPivot

Vector getRotationPivot ()

Get the rotation pivot of this Node. The rotation pivot defines the point about which rotation occurs.

Returns
Vector The pivot point as a Vector.

getRotationQuaternionRealtime

Quaternion getRotationQuaternionRealtime ()

Get the real-time orientation of this Node, expressed as a Quaternion. This returns the real-time orientation, meaning the orientation of the Node as it currently appears on-screen. Note this may not match the value last set by setRotation(Vector) because the real-time rotation is influenced by many factors: animation, the physics simulation, and more.

The returned orientation is the Node's local orientation (its orientation with respect to its parent). It does not take into the account the orientation of parent Nodes.

Returns
Quaternion The rotation in Quaternion form.

getScalePivot

Vector getScalePivot ()

Get the scale pivot of this Node. The scale pivot defines the point around which scaling occurs.

Returns
Vector The pivot point as a Vector.

getScaleRealtime

Vector getScaleRealtime ()

Get the real-time scale of this Node.

Note this may not match the value last set by setScale(Vector) because there may be an ongoing animation.

Returns
Vector The scale Vector.

getShadowCastingBitMask

int getShadowCastingBitMask ()

Get the shadow casting bit mask, which determines for which lights this Node will cast shadows.

Returns
int The bit mask.

getSounds

List<SpatialSound> getSounds ()

Get all SpatialSounds that have been added to this Node.

Returns
List<SpatialSound> List of all the SpatialSounds in this Node.

getTag

String getTag ()

Return the tag for this Node. The tag is a non-unique identifier that you can use for any purpose.

Returns
String The tag used by this Node, or null if no tag is set.

getTouchpadScrollListener

TouchpadScrollListener getTouchpadScrollListener ()

Get the TouchpadScrollListener that is currently installed for this Node.

Returns
TouchpadScrollListener The installed listener, or null if none is installed.

getTouchpadSwipeListener

TouchpadSwipeListener getTouchpadSwipeListener ()

Get the TouchpadSwipeListener that is currently installed for this Node.

Returns
TouchpadSwipeListener The installed listener, or null if none is installed.

getTouchpadTouchListener

TouchpadTouchListener getTouchpadTouchListener ()

Get the TouchpadTouchListener that is currently installed for this Node.

Returns
TouchpadTouchListener The installed listener, or null if none is installed.

getTransformBehaviors

EnumSet<Node.TransformBehavior> getTransformBehaviors ()

Return the Node.TransformBehaviors used by this Node.

Returns
EnumSet<Node.TransformBehavior> The TransformBehaviors in an EnumSet.

getWorldTransformRealTime

Matrix getWorldTransformRealTime ()

Get the real-time world transform of this Node. The world transform is the 4x4 Matrix transform that defines the Node's position, rotation, and scale. This is the world transform, meaning it takes into account all the transforms from parent Nodes. The transform is also real-time, so it may not match the position, rotation, or scale last set via setPosition(Vector), setRotation(Vector), and setScale(Vector) because its value is influenced by many other concurrent factors including animation, the physics simulation, and more.

Returns
Matrix The world transform as a 4x4 Matrix.

hasPhysics

boolean hasPhysics ()

Return true if this Node has a PhysicsBody attached, meaning its participates in the physics simulation.

Returns
boolean True if this Node participates in the physics simulation.

initPhysicsBody

PhysicsBody initPhysicsBody (PhysicsBody.RigidBodyType rigidBodyType, 
                float mass, 
                PhysicsShape shape)

Create a PhysicsBody for this Node, which makes the Node participate in the physics simulation. The PhysicsBody can be used to tune the way in which this Node responds to other physics bodies, global forces, and collisions.

Parameters
rigidBodyType PhysicsBody.RigidBodyType: The rigid body type, which controls how the Node responds to forces and collisions.

mass float: The mass of the PhysicsBody, in kilograms.

shape PhysicsShape: The shape of the PhysicsBody.

Returns
PhysicsBody The initialized PhysicsBody.

isVisible

boolean isVisible ()

Return true if this Node's visible property is true. Note this does not return whether the Node is *actually* visible in the user's current view; it only returns the value of this property.

Returns
boolean The visible property of this Node.

removeAllChildNodes

void removeAllChildNodes ()

Remove all children from this Node.

removeAllLights

void removeAllLights ()

Remove all Lights from this Node.

removeAllSounds

void removeAllSounds ()

Remove all SpatialSounds from this Node.

removeFixedParticleEmitter

void removeFixedParticleEmitter ()

Removes any attached FixedParticleEmitter from this Node.

removeFromParentNode

void removeFromParentNode ()

Remove this Node from its parent.

removeLight

void removeLight (Light light)

Remove the given Light from this Node.

Parameters
light Light: The Light to remove.

removeParticleEmitter

void removeParticleEmitter ()

Removes any attached ParticleEmitter from this Node.

removeSound

void removeSound (SpatialSound sound)

Remove the given SpatialSound from this Node.

Parameters
sound SpatialSound: The SpatialSound remove.

removeTransformListener

void removeTransformListener ()

Remove any Node.TransformListener that is currently attached to this Node.

setCamera

void setCamera (Camera camera)

Attach the given Camera to this Node. To make this Camera active, this Node must be set to the point of view via setPointOfView(Node).

Parameters
camera Camera: The Camera to add to this Node. Null to remove any set Camera.

setClickListener

void setClickListener (ClickListener listener)

Set a ClickListener to respond when users click with their Controller on this Node.

Parameters
listener ClickListener: The listener to attach, or null to remove any installed listener.

setDragListener

void setDragListener (DragListener listener)

Set the DragListener to respond when a user attempts to drag this Node by pressing over it and moving the Controller.

Parameters
listener DragListener: The listener to attach, or null to remove any installed listener.

setDragMaxDistance

void setDragMaxDistance (float maxDistance)

Set the maximum distance this Node can be dragged along the user-specified plane when drag type is set to FIXED_TO_PLANE.

Parameters
maxDistance float: The maximum drag distance from the camera.

setDragPlaneNormal

void setDragPlaneNormal (Vector planeNormal)

Specify the normal vector that (along with the point) defines the plane to use when dragging is set to FIXED_TO_PLANE.

Parameters
planeNormal Vector: The Vector specifying the plane's normal.

setDragPlanePoint

void setDragPlanePoint (Vector planePoint)

Specify the point that (along with the normal vector) defines the plane to use when dragging is set to FIXED_TO_PLANE. This point should be given in world coordinates.

Parameters
planePoint Vector: The Vector specifying the point in world coordinates.

setDragType

void setDragType (Node.DragType dragType)

Set the behavior of dragging if this Node has an attached DragListener.

Parameters
dragType Node.DragType: The Node.DragType to use.

setFixedParticleEmitter

void setFixedParticleEmitter (FixedParticleEmitter emitter)

Set the FixedParticleEmitter to use for this Node. FixedParticleEmitters are used for rendering large numbers of identical objects, like point clouds. Setting a FixedParticleEmitter will remove any Geometry currently attached to the Node, as well any other ParticleEmitter or FixedParticleEmitter.

Parameters
emitter FixedParticleEmitter: The emitter to use for this Node. Null to remove any FixedParticleEmitter from this Node.

setFuseListener

void setFuseListener (FuseListener listener)

Set the FuseListener to respond when a user hovers over this Node for setTimeToFuse(float) milliseconds. When this is set, the fuse 'reticle' will be enabled for this Node.

Parameters
listener FuseListener: The listener to attach, or null to remove any installed listener.

setGeometry

void setGeometry (Geometry geometry)

Set the Geometry of this Node. Geometries are the actual 3D objects that are rendered for each Node. Setting a Geometry will remove any attached ParticleEmitter from the Node.

Parameters
geometry Geometry: The Geometry to attach to this Node. Null to remove any Geometry from this Node.

setGesturePinchListener

void setGesturePinchListener (GesturePinchListener listener)

Set the GesturePinchListener to respond when a user pinches with two fingers over this Node using a screen Controller.

Parameters
listener GesturePinchListener: The listener to attach, or null to remove any installed listener.

setGestureRotateListener

void setGestureRotateListener (GestureRotateListener listener)

Set the GestureRotateListener to respond when a user rotates with two fingers over this Node using a screen Controller.

Parameters
listener GestureRotateListener: The listener to attach, or null to remove any installed listener.

setHighAccuracyEvents

void setHighAccuracyEvents (boolean highAccuracyEvents)

True if events should use the Geometry of this Node to determine if the user is interacting with this Node. If false, the Node's axis-aligned bounding box will be used instead. This makes events more accurate, but takes more processing power. The default value is false.

Parameters
highAccuracyEvents boolean: True to enable high accuracy events.

setHighAccuracyGaze

void setHighAccuracyGaze (boolean highAccuracyGaze)

This method is deprecated.
Use setHighAccuracyEvents(boolean)

True if onHover events should use the Geometry of this Node to determine if the user is hovering over this Node. If false, the Node's axis-aligned bounding box will be used instead. High accuracy gazing is more accurate but takes more processing power. The default value is false.

Parameters
highAccuracyGaze boolean: True to enable high accuracy gazing.

setHoverListener

void setHoverListener (HoverListener listener)

Set the HoverListener to respond when users hover over this Node.

Parameters
listener HoverListener: The listener to attach, or null to remove any installed listener.

setIgnoreEventHandling

void setIgnoreEventHandling (boolean ignore)

When set to true, this Node will ignore events and not prevent Nodes behind it from receiving event callbacks.

The default value is false.

Parameters
ignore boolean: True to make this Node ignore events.

setLightReceivingBitMask

void setLightReceivingBitMask (int bitMask)

Set the bit mask that determines what lights will illuminate this Node. This bit mask is bitwise and-ed (&) with each Light's influenceBitMask. If the result is > 0, then the Light will illuminate this Node. The default value is 0x1.

Parameters
bitMask int: The bit mask to set.

setName

void setName (String name)

Set a name to represent this Node. Names are user-specified and are not used internally by Viro.

Parameters
name String: The name to set for this Node.

setOpacity

void setOpacity (float opacity)

Set the opacity of this Node. A value of 0.0 means the contents of the Node are fully transparent, and a value of 1.0 means the contents of the Node are fully opaque. This applies to all the Node's children as well. A Node's final opacity is the opacity of its parents, and its own opacity, multiplied together.

Parameters
opacity float: The opacity from 0.0 to 1.0.

setParticleEmitter

void setParticleEmitter (ParticleEmitter emitter)

Set the ParticleEmitter to use for this Node. ParticleEmitters are used for rendering smoke, rain, confetti, and other particle effects. Setting a ParticleEmitter will remove any Geometry currently attached to the Node, as well as any other ParticleEmitter or FixedParticleEmitter.

Parameters
emitter ParticleEmitter: The emitter to use for this Node. Null to remove any ParticleEmitter from this Node.

setPosition

void setPosition (Vector position)

Set the position of this Node. The position defines the Node's location within the coordinate system of its parent. The default position is (0, 0, 0): the origin of the parent node’s coordinate system.

Parameters
position Vector: The position as a Vector.

setRenderingOrder

void setRenderingOrder (int renderingOrder)

Set the rendering order of this Node. This determines the order in which this Node is rendered relative to other Nodes. Nodes with greater rendering orders are rendered last. The default rendering order is zero. For example, setting a Node's rendering order to -1 will cause the Node to be rendered before all Nodes with rendering orders greater than or equal to 0.

Parameters
renderingOrder int: The rendering order, as an int.

setRotation

void setRotation (Quaternion rotation)

Set the orientation of this Node, expressed as a Quaternion.

Parameters
rotation Quaternion: The rotation in Quaternion form.

setRotation

void setRotation (Vector rotation)

Set the orientation of this Node, expressed as three Euler angles in a Vector. Specifically, the X component is rotation about the X axis (pitch), the Y component is rotation about the node's Y axis (yaw), and Z is the rotation around the node's Z axis (roll).

The rotation is made relative to the rotation pivot. See setRotationPivot(Vector).

Parameters
rotation Vector: Vector containing the rotation as three Euler angles in radians.

setRotationPivot

void setRotationPivot (Vector pivot)

Set the point on the Node about which rotation will occur. This defaults to the (0, 0, 0), the origin of the Node's coordinate system.

For example, imagine this Node's Geometry is a unit box (e.g. length 1.0 in each dimension). If the rotation pivot is (0, 0, 0) and we rotate about the Z axis, the box will spin about its center. If the rotation pivot is (-0.5, 0, -0.5) and we rotate about the Z axis, the box will spin around its far-left edge.

Parameters
pivot Vector: The pivot point as a Vector.

setScale

void setScale (Vector scale)

Set the scale of this node as a Vector. The Geometry of this Node (and all of its child Nodes), will have its dimension multiplied in each direction by the corresponding component of this vector. For example, if scale is (5, 5, 1), the Geometry's width and height would be increased 5x, but it's extent along the Z axis would remain constant.

The default scale is (1, 1, 1). Scale is applied relative to the scale pivot. See setScalePivot(Vector) .

Parameters
scale Vector: The scale Vector.

setScalePivot

void setScalePivot (Vector pivot)

Set the point on the Node around which scaling will occur. This defaults to the (0, 0, 0), the origin of the Node's coordinate system.

For example, imagine this Node's Geometry is a unit box (e.g. length 1.0 in each dimension). If the scale pivot is (0, 0, 0) and we scale by (2.0, 2.0, 2.0), the box will grow equally in each direction, remaining centered at (0, 0, 0) but with a new width, height, and length of (2, 2, 2).

If, however, the scale pivot is (-0.5, -0.5, 0.5) and we scale by the same amount, the box will only grow along the +X, +Y, and -Z dimensions (up, to the right, and away from the user). Its new center will be (1, 1, 1), and it's new width, height, and length will be (2, 2, 2).

Parameters
pivot Vector: The pivot point as a Vector.

setShadowCastingBitMask

void setShadowCastingBitMask (int bitMask)

Set the bit mask that determines for which lights the contents of this Node will cast shadows. This bit mask is bitwise and-ed (&) with each Light's influenceBitMask. If the result is > 0, then this Node will cast shadows from the light. The default value is 0x1.

Parameters
bitMask int: The bit mask to set.

setTag

void setTag (String tag)

Set the tag for this Node. The tag is a non-unique identifier that you can use for any purpose. Tags are also used in the physics simulation to identify objects in collisions.

Parameters
tag String: The tag to set, which is any arbitrary String.

setTimeToFuse

void setTimeToFuse (float millis)

Set the time in milliseconds the user must hover over a Node before a Fuse event is triggered on an installed FuseListener.

Parameters
millis float: The time in milliseconds before a Fuse is registered.

setTouchpadScrollListener

void setTouchpadScrollListener (TouchpadScrollListener listener)

Set the TouchpadScrollListener to respond when a user scrolls a touchpad while hovering over a Node.

Parameters
listener TouchpadScrollListener: The listener to attach, or null to remove any installed listener.

setTouchpadSwipeListener

void setTouchpadSwipeListener (TouchpadSwipeListener listener)

Set the TouchpadSwipeListener to respond when a user swipes across a touchpad Controller while hovering over this Node.

Parameters
listener TouchpadSwipeListener: The listener to attach, or null to remove any installed listener.

setTouchpadTouchListener

void setTouchpadTouchListener (TouchpadTouchListener listener)

Set the TouchpadTouchListener to respond when a user touches or moves across a touchpad Controller while hovering over this Node.

Parameters
listener TouchpadTouchListener: The listener to attach, or null to remove any installed listener.

setTransformBehaviors

void setTransformBehaviors (EnumSet<Node.TransformBehavior> transformBehaviors)

Set the Node.TransformBehaviors to use for this Node. Transform behaviors impact how a Node computes its position, rotation and scale.

Parameters
transformBehaviors EnumSet: The TransformBehaviors to set.

setTransformListener

void setTransformListener (Node.TransformListener transformListener, 
                double distanceFilter)

Set the Node.TransformListener for this Node. The listener will receive callbacks when the Node's position has changed.

Parameters
transformListener Node.TransformListener: The listener to set.

distanceFilter double: The listener will be notified whenever the Node's position has changed by at least this magnitude.

setVisible

void setVisible (boolean visible)

Set to false to hide this Node, and all of its children. The default value is true.

Parameters
visible boolean: True to reveal the Node, false to hide.

Hooray!