org.xith3d.scenegraph
Class TransformGroup

java.lang.Object
  extended by org.xith3d.scenegraph.SceneGraphObject
      extended by org.xith3d.scenegraph.Node
          extended by org.xith3d.scenegraph.GroupNode
              extended by org.xith3d.scenegraph.Group
                  extended by org.xith3d.scenegraph.TransformGroup
All Implemented Interfaces:
org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.spatial.SpatialNode, Transformable
Direct Known Subclasses:
AnimatableGroup, Bullet, GeneratorNode, Line2D, PointMassNode, Text2D, Transform

public class TransformGroup
extends Group
implements Transformable

TransformGroup node specifies a single spatial transformation, via a Transform3D object, that can position, orient and scale all of its children. The effects of transformations in the scene graph are cumulative.


Field Summary
 
Fields inherited from class org.xith3d.scenegraph.GroupNode
children, hostGroup, numChildren, totalNumChildren, totalNumShapes
 
Fields inherited from class org.xith3d.scenegraph.Node
bounds, boundsAutoCompute, boundsDirty, globalIgnoreBounds, instanceBoundsTypeHint, transformGroup, untransformedBounds
 
Fields inherited from class org.xith3d.scenegraph.SceneGraphObject
XITH3D_USERDATAKEY_OLDUSERDATA
 
Constructor Summary
TransformGroup()
          Constructs a new TransformGroup object.
TransformGroup(float translationX, float translationY, float translationZ)
           
TransformGroup(org.openmali.vecmath2.Matrix4f transform)
          Constructs a new TransformGroup object with the specified transform.
TransformGroup(Transform3D t)
          Constructs a new TransformGroup object with the specified transform.
TransformGroup(org.openmali.vecmath2.Tuple3f translation)
           
 
Method Summary
 Transform3D getLocalTransform()
           
 void getLocalTransform(Transform3D t)
           
 org.openmali.vecmath2.Point3f getPosition()
          Retrieves and returns the View's position from its Transform3D.
 void getPosition(org.openmali.vecmath2.Tuple3f position)
          Retrieves the View's position from its Transform3D and writes it into position.
 Transform3D getTransform()
          Gets the transform for this object.
 void getTransform(Transform3D t)
          Gets the transform for this object.
 Transform3D getWorldTransform()
          
protected  TransformGroup newInstance()
          
protected  void onTransformChanged()
           
 void setLocalTransform(Transform3D t)
           
 void setPosition(float posX, float posY, float posZ)
          Repositions the TransformNode
 void setPosition(org.openmali.vecmath2.Tuple3f position)
          Repositions the TransformNode
 void setTransform(Transform3D t)
          Sets the transform for this object.
 boolean traverse(DetailedTraversalCallback callback)
          Traverses the scenegraph from this node on.
 void updateTransform()
          Just reapplies this TransformGroup's Transform to mark it dirty.
 
Methods inherited from class org.xith3d.scenegraph.Group
moveTo
 
Methods inherited from class org.xith3d.scenegraph.GroupNode
absorbDetails, addChild, addChild, checkChild, dump, dump, ensureCapacity, expandBounds, findAll, findAll, findFirst, findFirst, freeOpenGLResources, getChild, getChildren, getChildren, getClipper, getPickHost, getScissorRect, getTotalNumChildren, getTotalNumShapes, indexOf, isPickHost, mergeInheritedClipper, mergeInheritedNodes, mergeInheritedScissorRect, numChildren, removeAllChildren, removeChild, removeChild, setBoundsDirty, setBoundsDirtyUpward, setChild, setClipper, setLive, setPickHost, setPickHost, setScissorRect, setShowBounds, sharedCopy, sharedCopy, traverse, unmergeInheritedFog, unmergeInheritedLight, unmergeInheritedNodes, updateBounds, updateBoundsCheap
 
Methods inherited from class org.xith3d.scenegraph.Node
cloneNode, detach, duplicateNode, freeOpenGLResources, getBounds, getBoundsAutoCompute, getBoundsType, getBoundsTypeHint, getDefaultPickable, getIndentString, getInheritedNodeAttributes, getModListener, getOrderedChild, getOrderedState, getParent, getRoot, getShadowAttachment, getShowBounds, getTransformGroup, getTreeCell, getWorldBounds, getWorldTransform, isBillboard, isIgnoreBounds, isOccluder, isPickable, isRenderable, isUpdatableNode, popGlobalIgnoreBounds, printBounds, pushGlobalIgnoreBounds, setBounds, setBoundsAutoCompute, setBoundsTypeHint, setDefaultPickable, setGlobalIgnoreBounds, setIgnoreBounds, setIsOccluder, setModListener, setOrderedChild, setParent, setPickable, setPickableRecursive, setPickableRecursive, setRenderable, setShadowAttachment, setShowBounds, setTransformGroup, setTreeCell, updateOrderedChild, updateTransformGroup, updateWorldTransform
 
Methods inherited from class org.xith3d.scenegraph.SceneGraphObject
getName, getUserData, getUserData, getUserDataMap, isLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xith3d.scenegraph.Transformable
getName, setName
 

Constructor Detail

TransformGroup

public TransformGroup(Transform3D t)
Constructs a new TransformGroup object with the specified transform.


TransformGroup

public TransformGroup(org.openmali.vecmath2.Matrix4f transform)
Constructs a new TransformGroup object with the specified transform.


TransformGroup

public TransformGroup()
Constructs a new TransformGroup object.


TransformGroup

public TransformGroup(float translationX,
                      float translationY,
                      float translationZ)

TransformGroup

public TransformGroup(org.openmali.vecmath2.Tuple3f translation)
Method Detail

onTransformChanged

protected final void onTransformChanged()

setTransform

public final void setTransform(Transform3D t)
Sets the transform for this object.

Specified by:
setTransform in interface Transformable

updateTransform

public final void updateTransform()
Just reapplies this TransformGroup's Transform to mark it dirty.


setLocalTransform

public final void setLocalTransform(Transform3D t)
Parameters:
t -
See Also:
setTransform(Transform3D)

getTransform

public final Transform3D getTransform()
Gets the transform for this object.

Specified by:
getTransform in interface Transformable

getLocalTransform

public final Transform3D getLocalTransform()
See Also:
getTransform()

getTransform

public final void getTransform(Transform3D t)
Description copied from interface: Transformable
Gets the transform for this object.

Specified by:
getTransform in interface Transformable

getLocalTransform

public final void getLocalTransform(Transform3D t)
Parameters:
t -
See Also:
getTransform(Transform3D)

setPosition

public void setPosition(float posX,
                        float posY,
                        float posZ)
Repositions the TransformNode

Specified by:
setPosition in interface Transformable
Parameters:
posX - the new x-position
posY - the new y-position
posZ - the new z-position

setPosition

public void setPosition(org.openmali.vecmath2.Tuple3f position)
Repositions the TransformNode

Specified by:
setPosition in interface Transformable
Parameters:
position - the new position

getPosition

public final void getPosition(org.openmali.vecmath2.Tuple3f position)
Retrieves the View's position from its Transform3D and writes it into position.

Specified by:
getPosition in interface Transformable
Parameters:
position - the tuple to write the positional data into.

getPosition

public final org.openmali.vecmath2.Point3f getPosition()
Retrieves and returns the View's position from its Transform3D.

Specified by:
getPosition in interface Transformable

getWorldTransform

public final Transform3D getWorldTransform()

Overrides:
getWorldTransform in class Node

newInstance

protected TransformGroup newInstance()

Overrides:
newInstance in class Group
Returns:
a new instance of this class. This is invoked by the sharedCopy() method.
See Also:
GroupNode.sharedCopy(CopyListener)

traverse

public final boolean traverse(DetailedTraversalCallback callback)
Traverses the scenegraph from this node on. If this Node is a Group it will recusively run through each child.

Overrides:
traverse in class Group
Parameters:
callback - the listener is notified of any traversed Node on the way
Returns:
if false, the whole traversal will stop