KudanAR - Android  1.6.0
ARNode Class Reference

Inherited by ARBillboardNode, ARBoneNode, ARCamera, ARMeshNode, ARModelNode, and ARWorld.

Public Member Functions

 ARNode ()
 
 ARNode (String name)
 
void remove ()
 
void removeAllChildren ()
 
void addChild (ARNode child)
 
ARNode getParent ()
 
void setParent (ARNode parent)
 
List< ARNodegetChildren ()
 
ARNode getWorld ()
 
Vector3f getPosition ()
 
void setPosition (Vector3f position)
 
void setPosition (float x, float y, float z)
 
void translateBy (float x, float y, float z)
 
void scaleBy (float x, float y, float z)
 
Vector3f getScale ()
 
void setScale (Vector3f scale)
 
void setScale (float x, float y, float z)
 
void scaleByUniform (float scale)
 
Quaternion getOrientation ()
 
void setOrientation (Quaternion orientation)
 
void setOrientation (float x, float y, float z, float w)
 
void rotateByQuaternion (Quaternion quaternion)
 
void rotateByDegrees (float angle, float x, float y, float z)
 
Matrix4f getFullTransform ()
 
Vector3f getFullScale ()
 
Quaternion getFullOrientation ()
 
Matrix4f getLocalTransform ()
 
Matrix4f getWorldTransform ()
 
void render ()
 
boolean getVisible ()
 
void setVisible (boolean visible)
 
Quaternion getWorldOrientation ()
 
Vector3f getWorldScale ()
 
Vector3f getWorldPosition ()
 
Vector3f getFullPosition ()
 
String getName ()
 
void setName (String name)
 
void preRender ()
 
void postRender ()
 
ARNode findChildByName (String name)
 
void addChildren (List< ARNode > children)
 
void translateByVector (Vector3f translation)
 
void scaleByVector (Vector3f scale)
 
void rotateByRadians (float angle, float x, float y, float z)
 

Detailed Description

An ARNode represents the base object of the scene-graph. It is responsible for the spatial layout of content, and is the node type from which all other nodes derive.

Constructor & Destructor Documentation

◆ ARNode() [1/2]

ARNode.ARNode ( )

Initialises an empty ARNode.

◆ ARNode() [2/2]

ARNode.ARNode ( String  name)

Creates a new ARNode and assigns it the given name.

Example of use:

ARNode node = new ARNode("Example Node");
Parameters
nameThe name to give this node.

Member Function Documentation

◆ addChild()

void ARNode.addChild ( ARNode  child)

Add a node as a child of this node. Any transformations applied to a node are inherited by its children.

Parameters
childThe node to be added.

◆ addChildren()

void ARNode.addChildren ( List< ARNode children)

Adds a list of nodes as children of this node.

Parameters
childrenThe list of nodes to be added as children.

◆ findChildByName()

ARNode ARNode.findChildByName ( String  name)

Find a child of this node with the given name. If there are multiple child nodes with the same name, any nodes after the first cannot be found, as this method will always return the first match. In order to be able to find all nodes, they must all have unique names.

Parameters
nameThe name of the node to search for.
Returns
The first ARNode in the list of children with the given name, or null if no such node is found.

◆ getChildren()

List<ARNode> ARNode.getChildren ( )

Returns a list containing all direct child nodes of this node. This only returns nodes added to this node as children. Any nodes added to those nodes will not be listed here.

Returns
A list containing all direct child nodes of this node.

◆ getFullOrientation()

Quaternion ARNode.getFullOrientation ( )

Get the nodes full orientation of the node in eye space.

Returns
The nodes full orientation.

◆ getFullPosition()

Vector3f ARNode.getFullPosition ( )

Gets the full position of the node in eye space.

Returns
A Vector3f representing this node's full position.

◆ getFullTransform()

Matrix4f ARNode.getFullTransform ( )

Gets the full transformation of this node in eye space.

Returns
A 4x4 matrix representing this node's full transform.

◆ getLocalTransform()

Matrix4f ARNode.getLocalTransform ( )

Gets the nodes transformation from its parent node.

Returns
A 4x4 matrix representing this node's local transform.

◆ getName()

String ARNode.getName ( )

Gets the name of this node.

Returns
The node's name.

◆ getOrientation()

Quaternion ARNode.getOrientation ( )

Returns the nodes local orientation as a quaternion;

Returns
This node's orientation relative to its parent.

◆ getParent()

ARNode ARNode.getParent ( )

Returns this node's parent node. If its parent is a root node, this returns null.

Returns
This node's parent node.

◆ getPosition()

Vector3f ARNode.getPosition ( )

Returns the position of this node relative to its parent in a vector.

Returns
This node's position relative to its parent.

◆ getScale()

Vector3f ARNode.getScale ( )

Gets the scale of this node, relative to its parent.

Returns
This node's scale relative to its parent.

◆ getVisible()

boolean ARNode.getVisible ( )

Gets whether or not this node and all of its child nodes should be drawn. If false, this node and its children will not render, even if the child's visibility is set to true.

Returns
This node's visibility. If visible is set to NO then no children will be rendered.

◆ getWorld()

ARNode ARNode.getWorld ( )

Returns the world node this node descends from.

Returns
The world node this node descends from.

◆ getWorldOrientation()

Quaternion ARNode.getWorldOrientation ( )

Gets the orientation of this node in the space of the nearest AR world this node descends from.

Returns
A Quaternion representing this node's world orientation.

◆ getWorldPosition()

Vector3f ARNode.getWorldPosition ( )

Gets the position of this node in the space of the nearest ARWorld this node descends from.

Returns
A Vector3f representing this node's world position.

◆ getWorldScale()

Vector3f ARNode.getWorldScale ( )

Gets the scale of this node in the space of the nearest ARWorld this node descends from.

Returns
A Vector3f representing this node's world scale.

◆ getWorldTransform()

Matrix4f ARNode.getWorldTransform ( )

Gets the nodes transformation from the nodes nearest world.

Returns
A 4x4 matrix representing this node's world transform.

◆ postRender()

void ARNode.postRender ( )

ARRendererListener interface method. Called after each frame is drawn.

◆ preRender()

void ARNode.preRender ( )

ARRendererListener interface method. Called before each frame is drawn.

Reimplemented in ARModelNode, and ARBillboardNode.

◆ remove()

void ARNode.remove ( )

Remove this node from its parent node.

◆ removeAllChildren()

void ARNode.removeAllChildren ( )

Remove all children from this node.

◆ render()

void ARNode.render ( )

Draws ARNode.

Reimplemented in ARMeshNode.

◆ rotateByDegrees()

void ARNode.rotateByDegrees ( float  angle,
float  x,
float  y,
float  z 
)

Rotate this node by the given number of degrees around the noted axes.

Example of use:

node.rotateByDegrees(90, 1, 0, 1);
Parameters
angleThe angle, in degrees, to rotate by.
xWhether or not to rotate about this node's X axis. 0 for no, 1 for yes.
yWhether or not to rotate about this node's X axis. 0 for no, 1 for yes.
zWhether or not to rotate about this node's X axis. 0 for no, 1 for yes.

◆ rotateByQuaternion()

void ARNode.rotateByQuaternion ( Quaternion  quaternion)

Rotate this node by multiplying its orientation by a quaternion.

Parameters
quaternionThe quaternion to rotate this node with.

◆ rotateByRadians()

void ARNode.rotateByRadians ( float  angle,
float  x,
float  y,
float  z 
)

Rotates ARNode using a 4 floats representing a quaternion.

Parameters
angleAngle of rotation in radians.
xRotation around the x axis.
yRotation around the y axis.
zRotation around the z axis.

◆ scaleBy()

void ARNode.scaleBy ( float  x,
float  y,
float  z 
)

Scale this node separately along each axis. Scale can be non-uniform.

Parameters
xThe amount to scale in the X-axis.
yThe amount to scale in the Y-axis.
zThe amount to scale in the Z-axis.

◆ scaleByUniform()

void ARNode.scaleByUniform ( float  scale)

Scale this node uniformly across each axis. This does not set the scale, but rather adds to the existing scale by the given amount. For example, if you scale a node by 2, then by 4, its overall scale will be 8 times bigger. Scaling occurs in the node's local space.

Example of use:

node.scaleByUniform(2);
Parameters
scaleThe factor to scale by.

◆ scaleByVector()

void ARNode.scaleByVector ( Vector3f  scale)

Scales ARNode using a Vector3f.

Parameters
scaleas a Vector3f

◆ setName()

void ARNode.setName ( String  name)

Sets the name of this node. The name should be unique so that the tracker can find it when using findChildByName.

Parameters
nameThe name to assign to this node.

◆ setOrientation() [1/2]

void ARNode.setOrientation ( float  x,
float  y,
float  z,
float  w 
)

Sets the node's orientation relative to its parent using 4 floats. This directly sets the quaternion representation of the node's orientation. This method is not recommended unless you have a thorough understanding of quaternions.

Parameters
xThe X component of the orientation.
yThe Y component of the orientation.
zThe Z component of the orientation.
wThe W component of the orientation.

◆ setOrientation() [2/2]

void ARNode.setOrientation ( Quaternion  orientation)

Sets node's orientation relative to its parent using a quaternion.

Parameters
orientation

◆ setParent()

void ARNode.setParent ( ARNode  parent)

Sets this node's parent node.

Parameters
parentThe node to assign as this node's parent.

◆ setPosition() [1/2]

void ARNode.setPosition ( float  x,
float  y,
float  z 
)

Set nodes position relative to their parent using three floats.

Parameters
xThe X component of the position.
yThe Y component of the position.
zThe Z component of the position.

◆ setPosition() [2/2]

void ARNode.setPosition ( Vector3f  position)

Sets the node's position relative to its parent using a vector.

Parameters
positionThe position to give this node.

◆ setScale() [1/2]

void ARNode.setScale ( float  x,
float  y,
float  z 
)

Sets the scale of a node using the provided floats.

Parameters
xThe scale to give this node in its local X-axis.
yThe scale to give this node in its local Y-axis.
zThe scale to give this node in its local Z-axis.

◆ setScale() [2/2]

void ARNode.setScale ( Vector3f  scale)

Sets the scale of the node, relative to its parent, using the given vector.

Parameters
scaleThe scale to give this node, represented as a vector.

◆ translateBy()

void ARNode.translateBy ( float  x,
float  y,
float  z 
)

Translates the position of this node in its own local space by the given number of units in each axis. This simply adds the given 3 values to each corresponding component of the node's position. It does not set the position of the node directly.

Parameters
xThe number of units to translate along the X-axis.
yThe number of units to translate along the Y-axis.
zThe number of units to translate along the Z-axis.

◆ translateByVector()

void ARNode.translateByVector ( Vector3f  translation)

Translates ARNode using a Vector3f.

Parameters
translation

The documentation for this class was generated from the following file: