javax.media.j3d
Class MorphRetained

java.lang.Object
  extended by javax.media.j3d.IndexedObject
      extended by javax.media.j3d.SceneGraphObjectRetained
          extended by javax.media.j3d.NodeRetained
              extended by javax.media.j3d.LeafRetained
                  extended by javax.media.j3d.MorphRetained
All Implemented Interfaces:
java.lang.Cloneable, GeometryUpdater, NnuId

 class MorphRetained
extends LeafRetained
implements GeometryUpdater

A morph leaf node consisting of geometery and appearance properties.


Field Summary
(package private)  AppearanceRetained appearance
          The appearance component of the morph node.
(package private) static int APPEARANCE_CHANGED
           
(package private) static int APPEARANCEOVERRIDE_CHANGED
           
(package private)  boolean appearanceOverrideEnable
           
(package private)  Bounds bounds
           
(package private) static int BOUNDS_CHANGED
           
(package private)  BranchGroupRetained[] branchGroupPath
          Reference to the BranchGroup path of this mirror shape This is used for picking only.
(package private)  int changedFrequent
           
(package private)  int closestSwitchIndex
           
(package private)  SwitchRetained closestSwitchParent
           
(package private) static int COLLISION_CHANGED
           
(package private)  Bounds collisionBound
           
(package private)  Bounds collisionVwcBound
           
(package private) static int GEOMETRY_CHANGED
           
(package private)  GeometryArrayRetained[] geometryArrays
          The Geosets associated with the morph node.
(package private)  boolean isCollidable
           
(package private)  boolean isPickable
           
(package private)  float[] Mcolor
           
(package private)  float[] Mcoord
           
(package private)  java.util.ArrayList mirrorShape3D
          The mirror Shape3DRetained nodes for this object.
(package private)  float[] Mnormal
           
(package private)  GeometryArray morphedGeometryArray
           
(package private)  float[][] MtexCoord
           
private  int numGeometryArrays
           
(package private) static int targetThreads
           
private static double TOLERANCE
           
(package private) static int UPDATE_MORPH
           
(package private)  boolean visible
           
(package private)  BoundingBox vwcBounds
           
(package private)  double[] weights
          The weight vector the morph node.
 
Fields inherited from class javax.media.j3d.LeafRetained
boundsDirty, switchState
 
Fields inherited from class javax.media.j3d.NodeRetained
ALTERNATEAPPEARANCE, AMBIENTLIGHT, apiBounds, BACKGROUND, BACKGROUNDSOUND, BEHAVIOR, BOUNDINGLEAF, boundsAutoCompute, BRANCHGROUP, branchGroupPaths, cachedBounds, childIndex, CLIP, collidable, CONESOUND, CONTAINS_VIEWPLATFORM, CURRENT_LOCAL_TO_VWORLD, DECALGROUP, DIRECTIONALLIGHT, EXPONENTIALFOG, geometryBackground, GROUP, inSharedGroup, LAST_LOCAL_TO_VWORLD, LINEARFOG, LINK, localBounds, locale, localToVworld, localToVworldIndex, localToVworldKeys, MODELCLIP, MORPH, nnuId, nodeId, nodeType, NUMNODES, ORDEREDGROUP, orderedId, ORIENTEDSHAPE3D, parent, parentSwitchLink, parentTransformLink, pickable, POINTLIGHT, POINTSOUND, refCount, SHAPE, SHAREDGROUP, SOUNDSCAPE, SPOTLIGHT, staticTransform, SWITCH, TRANSFORMGROUP, universe, validCachedBounds, VIEWPLATFORM, VIEWSPECIFICGROUP
 
Fields inherited from class javax.media.j3d.SceneGraphObjectRetained
DONT_MERGE, inBackgroundGroup, inSetLive, MERGE, MERGE_DONE, mergeFlag, onUpdateList, source
 
Fields inherited from class javax.media.j3d.IndexedObject
listIdx
 
Constructor Summary
MorphRetained()
           
 
Method Summary
(package private)  void clearLive(SetLiveState s)
          assign a name to this node when it is made live.
(package private)  void compile(CompileState compState)
          This is the default compile() method, which just marks the sgo as compiled.
(package private)  void computeCombineBounds(Bounds bounds)
          ONLY needed for SHAPE, MORPH, and LINK node type.
(package private)  void doErrorCheck(GeometryArrayRetained prevGeo, GeometryArrayRetained geo)
           
(package private)  Appearance getAppearance()
          Retrieves the morph node's appearance component.
(package private)  boolean getAppearanceOverrideEnable()
           
(package private)  Bounds getBounds()
          Gets the bounding object of a node.
(package private)  Bounds getCollisionBounds()
          Gets the collision bounds of a node.
(package private)  Bounds getEffectiveBounds()
          Gets the bounding object of a node.
(package private)  GeometryArray getGeometryArray(int index)
          Retrieves the geometryArrays component of this Morph node.
(package private)  void getMirrorObjects(java.util.ArrayList leafList, HashKey key)
           
(package private)  Shape3DRetained getMirrorShape(HashKey key)
           
(package private)  Shape3DRetained getMirrorShape(SceneGraphPath path)
           
(package private)  void getMirrorShape3D(java.util.ArrayList list, HashKey k)
           
(package private)  int getNumGeometryArrays()
           
(package private)  double[] getWeights()
          Retrieves the Morph node's weight vector
(package private)  void handleFrequencyChange(int bit)
           
(package private)  void initMorphedGeometry()
          Initialization of morphed geometry
(package private)  boolean intersect(PickInfo pickInfo, PickShape pickShape, int flags)
           
(package private)  boolean intersect(SceneGraphPath path, PickShape pickShape, double[] dist)
          Check if the geometry component of this shape node under path intersects with the pickShape.
(package private)  void searchGeometryAtoms(UnorderList list)
           
(package private)  void setAppearance(Appearance newAppearance)
          Sets the appearance component of this Morph node.
(package private)  void setAppearanceOverrideEnable(boolean flag)
           
(package private)  void setBounds(Bounds bounds)
          Sets the geometric bounds of a node.
(package private)  void setBoundsAutoCompute(boolean autoCompute)
          Sets the automatic calcuation of geometric bounds of a node.
(package private)  void setCollisionBounds(Bounds bounds)
          Sets the collision bounds of a node.
(package private)  void setGeometryArrays(GeometryArray[] geometryArrays)
          Sets the geometryArrays component of the Morph node.
(package private)  void setLive(SetLiveState s)
          assign a name to this node when it is made live.
(package private)  void setWeights(double[] weights)
          Sets the Morph node's weight vector
(package private)  void updateBounds()
           
(package private)  void updateCollidable(HashKey[] keys, boolean[] collide)
           
 void updateData(Geometry mga)
          Update GeometryArray computed by morphing input GeometryArrays with weights
(package private)  void updateImmediateMirrorObject(java.lang.Object[] objs)
           
(package private)  void updateMorphedGeometryArray(GeometryArrayRetained geo, boolean coordinatesChanged)
           
(package private)  void updatePickable(HashKey[] keys, boolean[] pick)
           
 
Methods inherited from class javax.media.j3d.LeafRetained
clone, updateBoundingLeaf, updateMirrorObject, updateTransformChange
 
Methods inherited from class javax.media.j3d.NodeRetained
computeNonLiveLocalToVworld, dirtyBoundsCache, doSetLive, equal, findCollidableFlags, findPickableFlags, findTransformLevels, getBoundsAutoCompute, getCollidable, getCurrentLocalToVworld, getCurrentLocalToVworld, getCurrentLocalToVworld, getId, getLastLocalToVworld, getLastLocalToVworld, getLastLocalToVworld, getLocalBounds, getLocale, getLocalToVworld, getLocalToVworld, getLocalToVworld, getParent, getPickable, getVirtualUniverse, isStatic, merge, mergeTransform, notifySceneGraphChanged, processViewSpecificInfo, recombineAbove, removeNodeData, setAuxData, setCollidable, setNodeData, setParent, setPickable, transformBounds, updateLocalToVworld
 
Methods inherited from class javax.media.j3d.SceneGraphObjectRetained
clearLive, clearLive, clone, doSetLive, getSource, isInSetLive, markAsLive, setCompiled, setLive, setSource, traverse
 
Methods inherited from class javax.media.j3d.IndexedObject
getIdxUsed, incIdxUsed
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GEOMETRY_CHANGED

static final int GEOMETRY_CHANGED
See Also:
Constant Field Values

APPEARANCE_CHANGED

static final int APPEARANCE_CHANGED
See Also:
Constant Field Values

COLLISION_CHANGED

static final int COLLISION_CHANGED
See Also:
Constant Field Values

BOUNDS_CHANGED

static final int BOUNDS_CHANGED
See Also:
Constant Field Values

APPEARANCEOVERRIDE_CHANGED

static final int APPEARANCEOVERRIDE_CHANGED
See Also:
Constant Field Values

UPDATE_MORPH

static final int UPDATE_MORPH
See Also:
Constant Field Values

TOLERANCE

private static final double TOLERANCE
See Also:
Constant Field Values

mirrorShape3D

java.util.ArrayList mirrorShape3D
The mirror Shape3DRetained nodes for this object. There is one mirror for each instance of this Shape3D node. If it is not in a SharedGroup, only index 0 is valid.


targetThreads

static final int targetThreads
See Also:
Constant Field Values

appearance

AppearanceRetained appearance
The appearance component of the morph node.


geometryArrays

GeometryArrayRetained[] geometryArrays
The Geosets associated with the morph node.


numGeometryArrays

private int numGeometryArrays

weights

double[] weights
The weight vector the morph node.


branchGroupPath

BranchGroupRetained[] branchGroupPath
Reference to the BranchGroup path of this mirror shape This is used for picking only.


isPickable

boolean isPickable

isCollidable

boolean isCollidable

closestSwitchParent

SwitchRetained closestSwitchParent

closestSwitchIndex

int closestSwitchIndex

visible

boolean visible

bounds

Bounds bounds

vwcBounds

BoundingBox vwcBounds

collisionBound

Bounds collisionBound

collisionVwcBound

Bounds collisionVwcBound

morphedGeometryArray

GeometryArray morphedGeometryArray

Mcoord

float[] Mcoord

Mcolor

float[] Mcolor

Mnormal

float[] Mnormal

MtexCoord

float[][] MtexCoord

appearanceOverrideEnable

boolean appearanceOverrideEnable

changedFrequent

int changedFrequent
Constructor Detail

MorphRetained

MorphRetained()
Method Detail

setCollisionBounds

void setCollisionBounds(Bounds bounds)
Sets the collision bounds of a node.

Parameters:
bounds - the bounding object for the node

setBounds

void setBounds(Bounds bounds)
Sets the geometric bounds of a node.

Overrides:
setBounds in class NodeRetained
Parameters:
bounds - the bounding object for the node

getCollisionBounds

Bounds getCollisionBounds()
Gets the collision bounds of a node.

Returns:
the node's bounding object

setGeometryArrays

void setGeometryArrays(GeometryArray[] geometryArrays)
Sets the geometryArrays component of the Morph node.

Parameters:
geometryArrays - the new vector of geometryArrays for the morph node

getGeometryArray

GeometryArray getGeometryArray(int index)
Retrieves the geometryArrays component of this Morph node.

Parameters:
index - the index of GeometryArray to be returned
Returns:
the geometryArray component of this morph node

setAppearance

void setAppearance(Appearance newAppearance)
Sets the appearance component of this Morph node.

Parameters:
appearance - the new apearance component for this morph node

getAppearance

Appearance getAppearance()
Retrieves the morph node's appearance component.

Returns:
the morph node's appearance

setAppearanceOverrideEnable

void setAppearanceOverrideEnable(boolean flag)

getAppearanceOverrideEnable

boolean getAppearanceOverrideEnable()

intersect

boolean intersect(PickInfo pickInfo,
                  PickShape pickShape,
                  int flags)

intersect

boolean intersect(SceneGraphPath path,
                  PickShape pickShape,
                  double[] dist)
Check if the geometry component of this shape node under path intersects with the pickShape.

Returns:
true if intersected else false. If return is true, dist contains the closest distance of intersection if it is not equal to null.

setWeights

void setWeights(double[] weights)
Sets the Morph node's weight vector

Parameters:
wieghts - the new vector of weights for the morph node

getWeights

double[] getWeights()
Retrieves the Morph node's weight vector

Returns:
the morph node's weight vector.

getBounds

Bounds getBounds()
Gets the bounding object of a node.

Overrides:
getBounds in class NodeRetained
Returns:
the node's bounding object

getEffectiveBounds

Bounds getEffectiveBounds()
Description copied from class: NodeRetained
Gets the bounding object of a node.

Overrides:
getEffectiveBounds in class NodeRetained
Returns:
the node's bounding object

computeCombineBounds

void computeCombineBounds(Bounds bounds)
ONLY needed for SHAPE, MORPH, and LINK node type. Compute the combine bounds of bounds and its localBounds.

Overrides:
computeCombineBounds in class NodeRetained

getNumGeometryArrays

int getNumGeometryArrays()

updateMorphedGeometryArray

void updateMorphedGeometryArray(GeometryArrayRetained geo,
                                boolean coordinatesChanged)

updateData

public void updateData(Geometry mga)
Update GeometryArray computed by morphing input GeometryArrays with weights

Specified by:
updateData in interface GeometryUpdater
Parameters:
mga - the Geometry object being updated.
See Also:
GeometryArray.updateData(javax.media.j3d.GeometryUpdater)

updateImmediateMirrorObject

void updateImmediateMirrorObject(java.lang.Object[] objs)

setLive

void setLive(SetLiveState s)
assign a name to this node when it is made live.

Overrides:
setLive in class NodeRetained

clearLive

void clearLive(SetLiveState s)
assign a name to this node when it is made live.

Overrides:
clearLive in class NodeRetained

updatePickable

void updatePickable(HashKey[] keys,
                    boolean[] pick)
Overrides:
updatePickable in class NodeRetained

updateCollidable

void updateCollidable(HashKey[] keys,
                      boolean[] collide)
Overrides:
updateCollidable in class NodeRetained

getMirrorShape

Shape3DRetained getMirrorShape(SceneGraphPath path)

getMirrorShape

Shape3DRetained getMirrorShape(HashKey key)

getMirrorObjects

void getMirrorObjects(java.util.ArrayList leafList,
                      HashKey key)
Overrides:
getMirrorObjects in class LeafRetained

setBoundsAutoCompute

void setBoundsAutoCompute(boolean autoCompute)
Description copied from class: NodeRetained
Sets the automatic calcuation of geometric bounds of a node.

Overrides:
setBoundsAutoCompute in class NodeRetained
Parameters:
autoCompute - is a boolean value indicating if automatic calcuation of bounds

updateBounds

void updateBounds()
Overrides:
updateBounds in class LeafRetained

initMorphedGeometry

void initMorphedGeometry()
Initialization of morphed geometry


getMirrorShape3D

void getMirrorShape3D(java.util.ArrayList list,
                      HashKey k)

compile

void compile(CompileState compState)
Description copied from class: SceneGraphObjectRetained
This is the default compile() method, which just marks the sgo as compiled.

Overrides:
compile in class SceneGraphObjectRetained

doErrorCheck

void doErrorCheck(GeometryArrayRetained prevGeo,
                  GeometryArrayRetained geo)

handleFrequencyChange

void handleFrequencyChange(int bit)
Overrides:
handleFrequencyChange in class SceneGraphObjectRetained

searchGeometryAtoms

void searchGeometryAtoms(UnorderList list)
Overrides:
searchGeometryAtoms in class NodeRetained


Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.