org.xith3d.scenegraph
Class Morph

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.Morph
All Implemented Interfaces:
org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject, org.openmali.spatial.SpatialNode

public class Morph
extends Shape3D

The Morph leaf node permits an application to morph between multiple GeometryArrays. The Morph node contains a single Appearance node, an array of GeometryArray objects, and an array of corresponding weights. The Morph node combines these GeometryArrays into an aggregate shape based on each GeometryArray's corresponding weight. Typically, Behavior nodes will modify the weights to achieve various morphing effects.

The following restrictions apply to each GeometryArray object in the specified array of GeometryArray objects:

- All N geometry arrays must be of the same type (that is, the same subclass of GeometryArray).

- The vertexFormat, texCoordSetCount, and validVertexCount must be the same for all N geometry arrays.

- The texCoordSetMap array must be identical (element-by-element) for all N geometry arrays.

- For IndexedGeometryArray objects, the validIndexCount must be the same for all N geometry arrays.

- For GeometryStripArray objects, the stripVertexCounts array must be identical (element-by-element) for all N geometry arrays.

- For IndexedGeometryStripArray objects, the stripIndexCounts array must be identical (element-by-element) for all N geometry arrays.

For indexed geometry, the array lengths of each enabled vertex component (coord, color, normal, texcoord) must be the same for all N geometry arrays. For IndexedGeometryArray objects, the vertex arrays are morphed before the indexes are applied. Only the indexes in the first geometry array (geometry[0]) are used when rendering the geometry.


Field Summary
static int ALLOW_GEOMETRY_ARRAY_READ
           
static int ALLOW_GEOMETRY_ARRAY_WRITE
           
static int ALLOW_WEIGHTS_READ
           
static int ALLOW_WEIGHTS_WRITE
           
 
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
Morph()
          Constructs a new Morph object with a null geometry array components and a null appearance component.
Morph(Geometry[] geometryArrays)
           
Morph(Geometry[] geometryArrays, Appearance appearance)
           
 
Method Summary
 Geometry getGeometryArray(int i)
           
 int getGeometryArrayCount()
           
 void setGeometryArrays(Geometry[] geometryArrays)
           
 void setWeights(double[] weights)
          Sets this Morph node's morph weight vector.
 
Methods inherited from class org.xith3d.scenegraph.Shape3D
absorbDetails, copy, freeOpenGLResources, getAppearance, getAppearance, getCustomComparable, getGeometry, 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

ALLOW_GEOMETRY_ARRAY_READ

public static final int ALLOW_GEOMETRY_ARRAY_READ
See Also:
Constant Field Values

ALLOW_GEOMETRY_ARRAY_WRITE

public static final int ALLOW_GEOMETRY_ARRAY_WRITE
See Also:
Constant Field Values

ALLOW_WEIGHTS_READ

public static final int ALLOW_WEIGHTS_READ
See Also:
Constant Field Values

ALLOW_WEIGHTS_WRITE

public static final int ALLOW_WEIGHTS_WRITE
See Also:
Constant Field Values
Constructor Detail

Morph

public Morph()
Constructs a new Morph object with a null geometry array components and a null appearance component.


Morph

public Morph(Geometry[] geometryArrays)

Morph

public Morph(Geometry[] geometryArrays,
             Appearance appearance)
Method Detail

setGeometryArrays

public void setGeometryArrays(Geometry[] geometryArrays)

getGeometryArray

public final Geometry getGeometryArray(int i)

setWeights

public void setWeights(double[] weights)
Sets this Morph node's morph weight vector. The Morph node "weights" the corresponding GeometryArray by the amount specified. The weights apply a morph weight vector component that creates the desired morphing effect. The length of the weights parameter must be equal to the length of the array with which this Morph node was created, otherwise an IllegalArgumentException is thrown. There is no requirement that sum of all weights should be equal to 1.0.


getGeometryArrayCount

public final int getGeometryArrayCount()