KudanAR - Android
ARNode Class Reference
+ Inheritance diagram for ARNode:

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 ()
 
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 ( )
inline

Initialises an empty ARNode.

ARNode ( String  name)
inline

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

void addChild ( ARNode  child)
inline

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.
void addChildren ( List< ARNode children)
inline

Adds a list of nodes as children of this node.

Parameters
childrenThe list of nodes to be added as children.
ARNode findChildByName ( String  name)
inline

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.
List<ARNode> getChildren ( )
inline

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.
Vector3f getFullPosition ( )
inline

Gets the full position of the node in eye space.

Returns
A Vector3f representing this node's full position.
Matrix4f getFullTransform ( )
inline

Gets the full transformation of this node in eye space.

Returns
A 4x4 matrix representing this node's full transform.
Matrix4f getLocalTransform ( )
inline

Gets the nodes transformation from its parent node.

Returns
A 4x4 matrix representing this node's local transform.
String getName ( )
inline

Gets the name of this node.

Returns
The node's name.
Quaternion getOrientation ( )
inline

Returns the nodes local orientation as a quaternion;

Returns
This node's orientation relative to its parent.
ARNode getParent ( )
inline

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

Returns
This node's parent node.
Vector3f getPosition ( )
inline

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

Returns
This node's position relative to its parent.
Vector3f getScale ( )
inline

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

Returns
This node's scale relative to its parent.
boolean getVisible ( )
inline

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.
ARNode getWorld ( )
inline

Returns the world node this node descends from.

Returns
The world node this node descends from.
Quaternion getWorldOrientation ( )
inline

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.
Vector3f getWorldPosition ( )
inline

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.
Vector3f getWorldScale ( )
inline

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.
Matrix4f getWorldTransform ( )
inline

Gets the nodes transformation from the nodes nearest world.

Returns
A 4x4 matrix representing this node's world transform.
void postRender ( )
inline

ARRendererListener interface method. Called after each frame is drawn.

void preRender ( )
inline

ARRendererListener interface method. Called before each frame is drawn.

void remove ( )
inline

Remove this node from its parent node.

void removeAllChildren ( )
inline

Remove all children from this node.

void render ( )
inline

Draws ARNode.

void rotateByDegrees ( float  angle,
float  x,
float  y,
float  z 
)
inline

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.
void rotateByQuaternion ( Quaternion  quaternion)
inline

Rotate this node by multiplying its orientation by a quaternion.

Parameters
quaternionThe quaternion to rotate this node with.
void rotateByRadians ( float  angle,
float  x,
float  y,
float  z 
)
inline

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.
void scaleBy ( float  x,
float  y,
float  z 
)
inline

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.
void scaleByUniform ( float  scale)
inline

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.
void scaleByVector ( Vector3f  scale)
inline

Scales ARNode using a Vector3f.

Parameters
scaleas a Vector3f
void setName ( String  name)
inline

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.
void setOrientation ( Quaternion  orientation)
inline

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

Parameters
orientation
void setOrientation ( float  x,
float  y,
float  z,
float  w 
)
inline

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.
void setParent ( ARNode  parent)
inline

Sets this node's parent node.

Parameters
parentThe node to assign as this node's parent.
void setPosition ( Vector3f  position)
inline

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

Parameters
positionThe position to give this node.
void setPosition ( float  x,
float  y,
float  z 
)
inline

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.
void setScale ( Vector3f  scale)
inline

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.
void setScale ( float  x,
float  y,
float  z 
)
inline

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.
void translateBy ( float  x,
float  y,
float  z 
)
inline

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.
void translateByVector ( Vector3f  translation)
inline

Translates ARNode using a Vector3f.

Parameters
translation

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