|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.media.j3d.SceneGraphObject
javax.media.j3d.Node
javax.media.j3d.Leaf
javax.media.j3d.Behavior
javax.media.j3d.LOD
javax.media.j3d.DistanceLOD
public class DistanceLOD
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:
Note that both the position and the array of distances are specified in the local coordinate system of this node.
Field Summary | |
---|---|
private Point3f |
center
|
private double[] |
distances
|
private Point3f |
position
|
private Point3f |
viewPosition
|
Fields inherited from class javax.media.j3d.LOD |
---|
switches, wakeupFrame |
Fields inherited from class javax.media.j3d.SceneGraphObject |
---|
nodeHashtable, retained |
Constructor Summary | |
---|---|
DistanceLOD()
Constructs and initializes a DistanceLOD node with default values. |
|
DistanceLOD(float[] distances)
Constructs and initializes a DistanceLOD node with the specified array of distances and a default position of (0,0,0). |
|
DistanceLOD(float[] distances,
Point3f position)
Constructs and initializes a DistanceLOD node with the specified array of distances and the specified position. |
Method Summary | |
---|---|
Node |
cloneNode(boolean forceDuplicate)
Used to create a new instance of the node. |
(package private) void |
duplicateAttributes(Node originalNode,
boolean forceDuplicate)
Copies all DistanceLOD information from originalNode into
the current node. |
double |
getDistance(int whichDistance)
Returns a particular LOD cut-off distance. |
void |
getPosition(Point3f position)
Retrieves the current position of this LOD node. |
void |
initialize()
Initialize method that sets up initial wakeup criteria. |
(package private) void |
mergeTransform(TransformGroupRetained xform)
|
int |
numDistances()
Returns a count of the number of LOD distance cut-off parameters. |
void |
processStimulus(java.util.Enumeration criteria)
Process stimulus method that computes appropriate level of detail. |
void |
setDistance(int whichDistance,
double distance)
Sets a particular LOD cut-off distance. |
void |
setPosition(Point3f position)
Sets the position of this LOD node. |
Methods inherited from class javax.media.j3d.LOD |
---|
addSwitch, getAllSwitches, getSwitch, indexOfSwitch, insertSwitch, numSwitches, removeAllSwitches, removeSwitch, removeSwitch, setSwitch, updateNodeReferences |
Methods inherited from class javax.media.j3d.Behavior |
---|
createRetained, getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, wakeupOn |
Methods inherited from class javax.media.j3d.Node |
---|
checkDuplicateNode, checkForCycle, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable |
Methods inherited from class javax.media.j3d.SceneGraphObject |
---|
capabilityBitsEmpty, checkForLiveOrCompiled, clearCapability, clearCapabilityIsFrequent, clearLive, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getNamePrefix, getNodeComponent, getUserData, isCompiled, isLive, isLiveOrCompiled, setCapability, setCapabilityIsFrequent, setCompiled, setDefaultReadCapabilities, setLive, setName, setUserData, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private double[] distances
private Point3f position
private Point3f center
private Point3f viewPosition
Constructor Detail |
---|
public DistanceLOD()
public DistanceLOD(float[] distances)
distances
- an array of values representing LOD cutoff distancespublic DistanceLOD(float[] distances, Point3f position)
distances
- an array of values representing LOD cutoff distancesposition
- the position of this LOD nodeMethod Detail |
---|
public void setPosition(Point3f position)
position
- the new positionpublic void getPosition(Point3f position)
position
- the object that will receive the current positionpublic int numDistances()
public double getDistance(int whichDistance)
whichDistance
- an index specifying which LOD distance to return
public void setDistance(int whichDistance, double distance)
whichDistance
- an index specifying which LOD distance to modifydistance
- the cut-off distance associated with the index providedpublic void initialize()
initialize
in class Behavior
public void processStimulus(java.util.Enumeration criteria)
processStimulus
in class Behavior
criteria
- an enumeration of the criteria that caused the
stimuluspublic Node cloneNode(boolean forceDuplicate)
cloneTree
to duplicate the current node.
cloneNode
in class Node
forceDuplicate
- when set to true
, causes the
duplicateOnCloneTree
flag to be ignored. When
false
, the value of each node's
duplicateOnCloneTree
variable determines whether
NodeComponent data is duplicated or copied.Node.cloneTree()
,
Node.cloneNode(boolean)
,
Node.duplicateNode(javax.media.j3d.Node, boolean)
,
NodeComponent.setDuplicateOnCloneTree(boolean)
void duplicateAttributes(Node originalNode, boolean forceDuplicate)
originalNode
into
the current node. This method is called from the
cloneNode
method which is, in turn, called by the
cloneTree
method.
duplicateAttributes
in class LOD
originalNode
- the original node to duplicate.forceDuplicate
- when set to true
, causes the
duplicateOnCloneTree
flag to be ignored. When
false
, the value of each node's
duplicateOnCloneTree
variable determines whether
NodeComponent data is duplicated or copied.
RestrictedAccessException
- if this object is part of a live
or compiled scenegraph.Node.duplicateNode(javax.media.j3d.Node, boolean)
,
Node.cloneTree()
,
NodeComponent.setDuplicateOnCloneTree(boolean)
void mergeTransform(TransformGroupRetained xform)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |