org.xith3d.scenegraph
Class Morph
java.lang.Object
org.xith3d.scenegraph.SceneGraphObject
org.xith3d.scenegraph.Node
org.xith3d.scenegraph.Leaf
org.xith3d.scenegraph.Shape3D
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.
| Methods inherited from class org.xith3d.scenegraph.Shape3D |
absorbDetails, freeOpenGLResources, getAppearance, getAppearance, getGeometry, isBumpMappingEnabled, isShadowReceiver, isVisible, newAppearance, setAppearance, setBounds, setBumpMappingEnabled, setBumpMappingEnabled, setGeometry, setIsShadowReceiver, setLive, setModListener, setVisible, sharedCopy, sharedCopy, traverse, updateBounds, updateBoundsCheap, updateWorldTransform, verifyAppChange |
| 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, setName, setUserData, setUserData, setUserDataRecursive, setUserDataRecursive, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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
Morph
public Morph()
- Constructs a new Morph object with a null geometry array components and
a null appearance component.
Morph
public Morph(GeometryArray[] geometryArrays)
Morph
public Morph(GeometryArray[] geometryArrays,
Appearance appearance)
setGeometryArrays
public void setGeometryArrays(GeometryArray[] geometryArrays)
getGeometryArray
public final GeometryArray 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()