org.xith3d.scenegraph
Class LODShape3D

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.scenegraph.AbstractLODShape3D
                      extended by org.xith3d.scenegraph.LODShape3D
All Implemented Interfaces:
org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.spatial.SpatialNode

public class LODShape3D
extends AbstractLODShape3D

The LODShape3D is a Shape3D Node extension, that handles discrete LOD. Discrete LOD (level of detail) is a technique, that selects an item depending on its distance to the camera.

See Also:
LODSwitch

Field Summary
 
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
LODShape3D()
          Constructs a new Shape3D object with specified geometry and appearance components.
 
Method Summary
 int addLOD(float minDist, float maxDist, Geometry geom, Appearance app)
          Adds a new LOD (level of detail).
 int addLOD(java.lang.String name, float minDist, float maxDist, Geometry geom, Appearance app)
          Adds a new LOD (level of detail).
protected  void copy(Shape3D dst)
          
protected  LODShape3D newInstance()
          
protected  void onLODChanged(int oldLOD, int newLOD, java.lang.String name)
          This eveent is fired when the LOD has changed.
 LODShape3D sharedCopy(CopyListener listener)
          Creates a shared copy of this Node.
 
Methods inherited from class org.xith3d.scenegraph.AbstractLODShape3D
addLOD, addLOD, getLODName, getMaxDist, getMinDist, getNumLODs, sharedCopy, updateLOD
 
Methods inherited from class org.xith3d.scenegraph.Shape3D
absorbDetails, freeOpenGLResources, getAppearance, getAppearance, getCustomComparable, getGeometry, isBumpMappingEnabled, isShadowReceiver, isVisible, newAppearance, setAppearance, setBounds, setBumpMappingEnabled, setBumpMappingEnabled, setCustomComparable, setGeometry, setIsShadowReceiver, setModListener, setVisible, 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
 

Constructor Detail

LODShape3D

public LODShape3D()
Constructs a new Shape3D object with specified geometry and appearance components.

Method Detail

onLODChanged

protected void onLODChanged(int oldLOD,
                            int newLOD,
                            java.lang.String name)
This eveent is fired when the LOD has changed.
This is always done by the redner thread.

Specified by:
onLODChanged in class AbstractLODShape3D
Parameters:
oldLOD - the old LOD
newLOD - the new LOD
name - the name of the new LOD

addLOD

public int addLOD(java.lang.String name,
                  float minDist,
                  float maxDist,
                  Geometry geom,
                  Appearance app)
Adds a new LOD (level of detail).

Parameters:
name - the name of the new LOD
minDist - the minimum distance
maxDist - the maximum distance
geom -
app -

addLOD

public int addLOD(float minDist,
                  float maxDist,
                  Geometry geom,
                  Appearance app)
Adds a new LOD (level of detail).

Parameters:
minDist - the minimum distance
maxDist - the maximum distance
geom -
app -

newInstance

protected LODShape3D newInstance()

Specified by:
newInstance in class AbstractLODShape3D
Returns:
a new instance of this class. This is invoked by the sharedCopy() method.
See Also:
Shape3D.sharedCopy(CopyListener)

copy

protected void copy(Shape3D dst)

Overrides:
copy in class AbstractLODShape3D

sharedCopy

public LODShape3D sharedCopy(CopyListener listener)
Creates a shared copy of this Node. A shared copy is one where the geometry and appearance is shared, but everything else is copied. This is a replacement for shared groups because of performance considerations. If you are loading the same model many times then this can save on memory and load times. The only allowable within the subtree are groups and shapes. This also copies a shapes bounds and turns autocomute off so that it is fast to insert the model into the scene.

Overrides:
sharedCopy in class AbstractLODShape3D
Returns:
a shared copy of this Node
See Also:
Node.absorbDetails(Node)