| java.lang.Object javax.media.j3d.SceneGraphObject javax.media.j3d.Node javax.media.j3d.Leaf javax.media.j3d.Behavior javax.media.j3d.LOD javax.media.j3d.DistanceLOD
DistanceLOD | public class DistanceLOD extends LOD (Code) | | This class defines a distance-based LOD behavior node that operates on
a Switch group node to select one of the children of that Switch node
based on the distance of this LOD node from the viewer.
An array of n monotonically increasing distance values is
specified, such that distances[0] is associated with the highest level of
detail and distances[n-1] is associated with the lowest level of
detail. Based on the actual distance from the viewer to
this DistanceLOD node, these n
distance values [0, n-1] select from among n+1
levels of detail [0, n]. If d is the distance from
the viewer to the LOD node, then the equation for determining
which level of detail (child of the Switch node) is selected is:
0, if d <= distances[0]
i, if distances[i-1] < d <= distances[i]
n, if d > distances[n-1]
Note that both the position and the array of distances are
specified in the local coordinate system of this node.
|
Constructor Summary | |
public | DistanceLOD() Constructs and initializes a DistanceLOD node with default values. | public | DistanceLOD(float[] distances) Constructs and initializes a DistanceLOD node with the specified
array of distances and a default position of (0,0,0). | public | DistanceLOD(float[] distances, Point3f position) Constructs and initializes a DistanceLOD node with the specified
array of distances and the specified position. |
Method Summary | |
public Node | cloneNode(boolean forceDuplicate) Used to create a new instance of the node. | void | duplicateAttributes(Node originalNode, boolean forceDuplicate) Copies all DistanceLOD information from
originalNode into
the current node. | public double | getDistance(int whichDistance) Returns a particular LOD cut-off distance. | public void | getPosition(Point3f position) Retrieves the current position of this LOD node. | public void | initialize() Initialize method that sets up initial wakeup criteria. | void | mergeTransform(TransformGroupRetained xform) | public int | numDistances() Returns a count of the number of LOD distance cut-off parameters. | public void | processStimulus(Enumeration criteria) Process stimulus method that computes appropriate level of detail. | public void | setDistance(int whichDistance, double distance) Sets a particular LOD cut-off distance. | public void | setPosition(Point3f position) Sets the position of this LOD node. |
DistanceLOD | public DistanceLOD()(Code) | | Constructs and initializes a DistanceLOD node with default values.
Note that the default constructor creates a DistanceLOD object with
a single distance value set to 0.0 and is, therefore, not useful.
|
DistanceLOD | public DistanceLOD(float[] distances)(Code) | | Constructs and initializes a DistanceLOD node with the specified
array of distances and a default position of (0,0,0).
Parameters: distances - an array of values representing LOD cutoff distances |
DistanceLOD | public DistanceLOD(float[] distances, Point3f position)(Code) | | Constructs and initializes a DistanceLOD node with the specified
array of distances and the specified position.
Parameters: distances - an array of values representing LOD cutoff distances Parameters: position - the position of this LOD node |
cloneNode | public Node cloneNode(boolean forceDuplicate)(Code) | | Used to create a new instance of the node. This routine is called
by cloneTree to duplicate the current node.
Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. See Also: Node.cloneTree See Also: Node.cloneNode See Also: Node.duplicateNode See Also: NodeComponent.setDuplicateOnCloneTree |
duplicateAttributes | void duplicateAttributes(Node originalNode, boolean forceDuplicate)(Code) | | Copies all DistanceLOD information from
originalNode into
the current node. This method is called from the
cloneNode method which is, in turn, called by the
cloneTree method.
Parameters: originalNode - the original node to duplicate. Parameters: forceDuplicate - when set to true , causes theduplicateOnCloneTree flag to be ignored. Whenfalse , the value of each node'sduplicateOnCloneTree variable determines whetherNodeComponent data is duplicated or copied. exception: RestrictedAccessException - if this object is part of a liveor compiled scenegraph. See Also: Node.duplicateNode See Also: Node.cloneTree See Also: NodeComponent.setDuplicateOnCloneTree |
getDistance | public double getDistance(int whichDistance)(Code) | | Returns a particular LOD cut-off distance.
Parameters: whichDistance - an index specifying which LOD distance to return the cut-off distance value associated with the index provided |
getPosition | public void getPosition(Point3f position)(Code) | | Retrieves the current position of this LOD node. This position is
in the local coordinates of this node.
Parameters: position - the object that will receive the current position |
initialize | public void initialize()(Code) | | Initialize method that sets up initial wakeup criteria.
|
numDistances | public int numDistances()(Code) | | Returns a count of the number of LOD distance cut-off parameters.
Note that the number of levels of detail (children of the Switch node)
is one greater than the number of distance values.
a count of the LOD cut-off distances |
processStimulus | public void processStimulus(Enumeration criteria)(Code) | | Process stimulus method that computes appropriate level of detail.
Parameters: criteria - an enumeration of the criteria that caused thestimulus |
setDistance | public void setDistance(int whichDistance, double distance)(Code) | | Sets a particular LOD cut-off distance.
Parameters: whichDistance - an index specifying which LOD distance to modify Parameters: distance - the cut-off distance associated with the index provided |
setPosition | public void setPosition(Point3f position)(Code) | | Sets the position of this LOD node. This position is specified in
the local coordinates of this node, and is
the position from which the distance to the viewer is computed.
Parameters: position - the new position |
|
|