Class Morph
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 by-reference, 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
FieldsModifier and TypeFieldDescriptionstatic final int
Deprecated.Specifies that this node allows reading its appearance override enable flag.static final int
Deprecated.Specifies that this node allows writing its appearance override enable flag.static final int
Deprecated.Specifies that the node allows read access to its appearance information.static final int
Deprecated.Specifies that the node allows write access to its appearance information.static final int
Deprecated.Specifies that the node allows reading its collision Bounds.static final int
Deprecated.Specifies the node allows writing its collision Bounds.static final int
Deprecated.Specifies that the node allows read access to its geometry information.static final int
Deprecated.Specifies that the node allows write access to its geometry information.static final int
Deprecated.Specifies that the node allows read access to its morph weight vector.static final int
Deprecated.Specifies that the node allows write access to its morph weight vector.Fields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
-
Constructor Summary
ConstructorsConstructorDescriptionMorph
(GeometryArray[] geometryArrays) Deprecated.Constructs and initializes a Morph node with the specified array of GeometryArray objects.Morph
(GeometryArray[] geometryArrays, Appearance appearance) Deprecated.Constructs and initializes a Morph node with the specified array of GeometryArray objects and the specified appearance object. -
Method Summary
Modifier and TypeMethodDescriptioncloneNode
(boolean forceDuplicate) Deprecated.Creates a new instance of the node.void
duplicateNode
(Node originalNode, boolean forceDuplicate) Deprecated.Copies all node information fromoriginalNode
into the current node.Deprecated.Retrieves the appearance component of this morph node.boolean
Deprecated.Retrieves the appearanceOverrideEnable flag for this node.Deprecated.Returns the collision bounding object of this node.getGeometryArray
(int index) Deprecated.Retrieves the geometryArray component of this Morph node.double[]
Deprecated.Retrieves the Morph node's morph weight vector.boolean
intersect
(SceneGraphPath path, PickRay pickRay, double[] dist) Deprecated.Checks whether the geometry in this morph node intersects with the specified pickRay.boolean
intersect
(SceneGraphPath path, PickShape pickShape) Deprecated.Checks whether the geometry in this morph node intersects with the specified pickShape.boolean
intersect
(SceneGraphPath path, PickShape pickShape, double[] dist) Deprecated.Checks whether the geometry in this morph node intersects with the specified pickShape.void
setAppearance
(Appearance appearance) Deprecated.Sets the appearance component of this Morph node.void
setAppearanceOverrideEnable
(boolean flag) Deprecated.Sets a flag that indicates whether this node's appearance can be overridden.void
setCollisionBounds
(Bounds bounds) Deprecated.Sets the collision bounds of a node.void
setGeometryArrays
(GeometryArray[] geometryArrays) Deprecated.Sets the geometryArrays component of the Morph node.void
setWeights
(double[] weights) Deprecated.Sets this Morph node's morph weight vector.Methods inherited from class javax.media.j3d.Node
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
-
Field Details
-
ALLOW_GEOMETRY_ARRAY_READ
public static final int ALLOW_GEOMETRY_ARRAY_READDeprecated.Specifies that the node allows read access to its geometry information.- See Also:
-
ALLOW_GEOMETRY_ARRAY_WRITE
public static final int ALLOW_GEOMETRY_ARRAY_WRITEDeprecated.Specifies that the node allows write access to its geometry information.- See Also:
-
ALLOW_APPEARANCE_READ
public static final int ALLOW_APPEARANCE_READDeprecated.Specifies that the node allows read access to its appearance information.- See Also:
-
ALLOW_APPEARANCE_WRITE
public static final int ALLOW_APPEARANCE_WRITEDeprecated.Specifies that the node allows write access to its appearance information.- See Also:
-
ALLOW_WEIGHTS_READ
public static final int ALLOW_WEIGHTS_READDeprecated.Specifies that the node allows read access to its morph weight vector.- See Also:
-
ALLOW_WEIGHTS_WRITE
public static final int ALLOW_WEIGHTS_WRITEDeprecated.Specifies that the node allows write access to its morph weight vector.- See Also:
-
ALLOW_COLLISION_BOUNDS_READ
public static final int ALLOW_COLLISION_BOUNDS_READDeprecated.Specifies that the node allows reading its collision Bounds.- See Also:
-
ALLOW_COLLISION_BOUNDS_WRITE
public static final int ALLOW_COLLISION_BOUNDS_WRITEDeprecated.Specifies the node allows writing its collision Bounds.- See Also:
-
ALLOW_APPEARANCE_OVERRIDE_READ
public static final int ALLOW_APPEARANCE_OVERRIDE_READDeprecated.Specifies that this node allows reading its appearance override enable flag.- Since:
- Java 3D 1.2
- See Also:
-
ALLOW_APPEARANCE_OVERRIDE_WRITE
public static final int ALLOW_APPEARANCE_OVERRIDE_WRITEDeprecated.Specifies that this node allows writing its appearance override enable flag.- Since:
- Java 3D 1.2
- See Also:
-
-
Constructor Details
-
Morph
Deprecated.Constructs and initializes a Morph node with the specified array of GeometryArray objects. Default values are used for all other parameters as follows:-
appearance : null
weights : [1, 0, 0, 0, ...]
collision bounds : null
appearance override enable : false
A null appearance object specifies that default values are used for all appearance attributes.
- Parameters:
geometryArrays
- the geometry components of the morph; a null or zero-length array of GeometryArray objects is permitted, and specifies that no geometry is drawn. In this case, the array of weights is initialized to a zero-length array.- Throws:
IllegalArgumentException
- if any of the specified geometry array objects differ from each other in any of the following ways:- Type of geometry array object (subclass of GeometryArray)
- vertexFormat
- texCoordSetCount
- texCoordSetMap
- validVertexCount
- validIndexCount, for IndexedGeometryArray objects
- stripVertexCounts array, for GeometryStripArray objects
- stripIndexCounts array, for IndexedGeometryStripArray objects
- the array lengths of each enabled vertex component (coord, color, normal, texcoord), for indexed geometry by-reference
UnsupportedOperationException
- if the specified geometry arrays contain vertex attributes (that is, if their vertexFormat includes theVERTEX_ATTRIBUTES
flag).
-
Morph
Deprecated.Constructs and initializes a Morph node with the specified array of GeometryArray objects and the specified appearance object.- Parameters:
geometryArrays
- the geometry components of the Morph node a null or zero-length array of GeometryArray objects is permitted, and specifies that no geometry is drawn. In this case, the array of weights is initialized to a zero-length array.appearance
- the appearance component of the Morph node- Throws:
IllegalArgumentException
- if any of the specified geometry array objects differ from each other in any of the following ways:- Type of geometry array object (subclass of GeometryArray)
- vertexFormat
- texCoordSetCount
- texCoordSetMap
- validVertexCount
- validIndexCount, for IndexedGeometryArray objects
- stripVertexCounts array, for GeometryStripArray objects
- stripIndexCounts array, for IndexedGeometryStripArray objects
- the array lengths of each enabled vertex component (coord, color, normal, texcoord), for indexed geometry by-reference
UnsupportedOperationException
- if the specified geometry arrays contain vertex attributes (that is, if their vertexFormat includes theVERTEX_ATTRIBUTES
flag).
-
-
Method Details
-
setCollisionBounds
Deprecated.Sets the collision bounds of a node.- Parameters:
bounds
- the collision bounding object for a node- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
getCollisionBounds
Deprecated.Returns the collision bounding object of this node.- Returns:
- the node's collision bounding object
- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
setGeometryArrays
Deprecated.Sets the geometryArrays component of the Morph node. If the current array of GeometryArrays in this Morph object is non-null with a length greater than 0, the specified array of GeometryArrays must be the same length as the current array. If the current array of GeometryArrays in this Morph object is null or has a length of 0, and the specified array of GeometryArrays is non-null with a length greater than 0, the length of the incoming array defines the number of the geometry objects that will be morphed. In this case, the weights array is allocated to be of the same length as the geometry array; the first element (weights[0]) is initialized to 1.0 and all of the other weights are initialized to 0.0.- Parameters:
geometryArrays
- the new geometryArrays component for the Morph node.- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graphIllegalArgumentException
- if the length of the specified array of geometry arrays is not equal to the length of this Morph node's current array of geometry arrays (and the current array's length is non-zero), or if any of the specified geometry array objects differ from each other in any of the following ways:- Type of geometry array object (subclass of GeometryArray)
- vertexFormat
- texCoordSetCount
- texCoordSetMap
- validVertexCount
- validIndexCount, for IndexedGeometryArray objects
- stripVertexCounts array, for GeometryStripArray objects
- stripIndexCounts array, for IndexedGeometryStripArray objects
- the array lengths of each enabled vertex component (coord, color, normal, texcoord), for indexed geometry by-reference
UnsupportedOperationException
- if the specified geometry arrays contain vertex attributes (that is, if their vertexFormat includes theVERTEX_ATTRIBUTES
flag).
-
getGeometryArray
Deprecated.Retrieves the geometryArray component of this Morph node.- Parameters:
index
- the index of GeometryArray to be returned- Returns:
- the geometryArray component of this Morph node
- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
setAppearance
Deprecated.Sets the appearance component of this Morph node. A null appearance component specifies that default values are used for all appearance attributes.- Parameters:
appearance
- the new appearance component for this Morph node- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
getAppearance
Deprecated.Retrieves the appearance component of this morph node.- Returns:
- the appearance component of this morph node
- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
intersect
Deprecated.Checks whether the geometry in this morph node intersects with the specified pickShape.- Parameters:
path
- the SceneGraphPath to this morph nodepickShape
- the PickShape to be intersected- Returns:
- true if the pick shape intersects this node; false otherwise.
- Throws:
IllegalArgumentException
- if pickShape is a PickPoint. Java 3D doesn't have spatial information of the surface. Use PickBounds with BoundingSphere and a small radius, instead.CapabilityNotSetException
- if the Geometry.ALLOW_INTERSECT capability bit is not set in all of the Geometry objects referred to by this morph node.
-
intersect
Deprecated.Checks whether the geometry in this morph node intersects with the specified pickRay.- Parameters:
path
- the SceneGraphPath to this morph nodepickRay
- the PickRay to be intersecteddist
- the closest distance of the intersection- Returns:
- true if the pick shape intersects this node; false otherwise. If true, dist contains the closest distance of intersection.
- Throws:
CapabilityNotSetException
- if the Geometry.ALLOW_INTERSECT capability bit is not set in all of the Geometry objects referred to by this morph node.
-
intersect
Deprecated.Checks whether the geometry in this morph node intersects with the specified pickShape.- Parameters:
path
- the SceneGraphPath to this morph nodepickShape
- the PickShape to be intersecteddist
- the closest distance of the intersection- Returns:
- true if the pick shape intersects this node; false otherwise. If true, dist contains the closest distance of intersection.
- Throws:
IllegalArgumentException
- if pickShape is a PickPoint. Java 3D doesn't have spatial information of the surface. Use PickBounds with BoundingSphere and a small radius, instead.CapabilityNotSetException
- if the Geometry.ALLOW_INTERSECT capability bit is not set in all of the Geometry objects referred to by this morph node.- Since:
- Java 3D 1.3
-
setWeights
public void setWeights(double[] weights) Deprecated.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 theweights
parameter must be equal to the length of the array with which this Morph node was created, otherwise an IllegalArgumentException is thown.- Parameters:
weights
- the morph weight vector that the morph node will use in combining the node's geometryArrays. The morph node will "weight" the corresponding GeometryArray by the amount specified. N.B.: the sum of the weights should equal 1.0- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graphIllegalArgumentException
- if sum of all 'weights' is NOT 1.0 or number of weights is NOT exqual to number of GeometryArrays.
-
getWeights
public double[] getWeights()Deprecated.Retrieves the Morph node's morph weight vector.- Returns:
- the morph weight vector component of this morph node
- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
setAppearanceOverrideEnable
public void setAppearanceOverrideEnable(boolean flag) Deprecated.Sets a flag that indicates whether this node's appearance can be overridden. If the flag is true, this node's appearance may be overridden by an AlternateAppearance leaf node, regardless of the value of the ALLOW_APPEARANCE_WRITE capability bit. The default value is false.- Parameters:
flag
- the apperance override enable flag- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph- Since:
- Java 3D 1.2
- See Also:
-
getAppearanceOverrideEnable
public boolean getAppearanceOverrideEnable()Deprecated.Retrieves the appearanceOverrideEnable flag for this node.- Returns:
- true if the appearance can be overridden; false otherwise.
- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph- Since:
- Java 3D 1.2
-
cloneNode
Deprecated.Creates a new instance of the node. This routine is called bycloneTree
to duplicate the current node. -
duplicateNode
Deprecated.Copies all node information fromoriginalNode
into the current node. This method is called from thecloneNode
method which is, in turn, called by thecloneTree
method.For any
NodeComponent
objects contained by the object being duplicated, eachNodeComponent
object'sduplicateOnCloneTree
value is used to determine whether theNodeComponent
should be duplicated in the new node or if just a reference to the current node should be placed in the new node. This flag can be overridden by setting theforceDuplicate
parameter in thecloneTree
method totrue
.
NOTE: Applications should not call this method directly. It should only be called by the cloneNode method.- Overrides:
duplicateNode
in classNode
- Parameters:
originalNode
- the original node to duplicate.forceDuplicate
- when set totrue
, causes theduplicateOnCloneTree
flag to be ignored. Whenfalse
, the value of each node'sduplicateOnCloneTree
variable determines whether NodeComponent data is duplicated or copied.- Throws:
ClassCastException
- if originalNode is not an instance ofMorph
- See Also:
-