org.xith3d.utility.geometry
Class NormalsVisualizer

java.lang.Object
  extended by org.xith3d.scenegraph.SceneGraphObject
      extended by org.xith3d.scenegraph.Node
          extended by org.xith3d.scenegraph.Leaf
              extended by org.xith3d.scenegraph.Shape3D
                  extended by org.xith3d.utility.geometry.NormalsVisualizer
All Implemented Interfaces:
org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.spatial.SpatialNode

public class NormalsVisualizer
extends Shape3D

This class visualizes the normals of a Shape3D's Geometry.
It must be placed into the same TransformGroup as the opbject Shape3D.


Field Summary
static org.openmali.vecmath2.Colorf DEFAULT_NORMAL_COLOR
           
 
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
NormalsVisualizer(Shape3D object)
          Create a new NormalsVisualizer for the given object Shape3D.
NormalsVisualizer(Shape3D object, org.openmali.vecmath2.Colorf color)
          Create a new NormalsVisualizer for the given object Shape3D.
NormalsVisualizer(Shape3D object, org.openmali.vecmath2.Colorf color, float normalScale)
          Create a new NormalsVisualizer for the given object Shape3D.
NormalsVisualizer(Shape3D object, float normalScale)
          Create a new NormalsVisualizer for the given object Shape3D.
 
Method Summary
 LineArray getGeometry()
          
 float getNormalScale()
           
 void setColor(org.openmali.vecmath2.Colorf color)
          Sets the color for the normals lines.
 void setNormalScale(float scale)
          Sets the scale factor for the visualized normals.
 void update()
          Updates the normals lines in this Shape's LineArray.
 
Methods inherited from class org.xith3d.scenegraph.Shape3D
absorbDetails, copy, freeOpenGLResources, getAppearance, getAppearance, getCustomComparable, isBumpMappingEnabled, isShadowReceiver, isVisible, newAppearance, newInstance, setAppearance, setBounds, setBumpMappingEnabled, setBumpMappingEnabled, setCustomComparable, setGeometry, setIsShadowReceiver, setModListener, setVisible, sharedCopy, sharedCopy, traverse, updateBounds, updateBoundsCheap, updateWorldTransform, verifyAppChange
 
Methods inherited from class org.xith3d.scenegraph.Leaf
dump, getPickHost, setPickHost
 
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, getWorldTransform, isBillboard, isIgnoreBounds, isOccluder, isPickable, isRenderable, isUpdatableNode, mergeInheritedClipper, mergeInheritedNodes, mergeInheritedScissorRect, popGlobalIgnoreBounds, printBounds, pushGlobalIgnoreBounds, setBoundsAutoCompute, setBoundsDirty, setBoundsDirtyUpward, setBoundsTypeHint, setDefaultPickable, setGlobalIgnoreBounds, setIgnoreBounds, setIsOccluder, setOrderedChild, setParent, setPickable, setPickableRecursive, setPickableRecursive, setRenderable, setShadowAttachment, setShowBounds, setTransformGroup, setTreeCell, traverse, unmergeInheritedFog, unmergeInheritedLight, unmergeInheritedNodes, updateOrderedChild, updateTransformGroup
 
Methods inherited from class org.xith3d.scenegraph.SceneGraphObject
getName, getUserData, getUserData, getUserDataMap, isLive, setLive, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_NORMAL_COLOR

public static final org.openmali.vecmath2.Colorf DEFAULT_NORMAL_COLOR
Constructor Detail

NormalsVisualizer

public NormalsVisualizer(Shape3D object,
                         org.openmali.vecmath2.Colorf color,
                         float normalScale)
Create a new NormalsVisualizer for the given object Shape3D. Directly calls update().

Parameters:
object - the object Shape3D
color -
normalScale -

NormalsVisualizer

public NormalsVisualizer(Shape3D object,
                         org.openmali.vecmath2.Colorf color)
Create a new NormalsVisualizer for the given object Shape3D. Directly calls update().

Parameters:
object - the object Shape3D
color -

NormalsVisualizer

public NormalsVisualizer(Shape3D object,
                         float normalScale)
Create a new NormalsVisualizer for the given object Shape3D. Directly calls update().

Parameters:
object - the object Shape3D
normalScale -

NormalsVisualizer

public NormalsVisualizer(Shape3D object)
Create a new NormalsVisualizer for the given object Shape3D. Directly calls update().

Parameters:
object - the object Shape3D
Method Detail

getGeometry

public LineArray getGeometry()

Overrides:
getGeometry in class Shape3D
Returns:
the Geometry for this object.

setNormalScale

public void setNormalScale(float scale)
Sets the scale factor for the visualized normals.

Parameters:
scale -

getNormalScale

public float getNormalScale()
Returns:
the scale factor for the visualized normals.

update

public void update()
Updates the normals lines in this Shape's LineArray. (synchronizes them with the object Shape3D)


setColor

public void setColor(org.openmali.vecmath2.Colorf color)
Sets the color for the normals lines.

Parameters:
color -