|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.media.j3d.SceneGraphObject | +--javax.media.j3d.Node | +--javax.media.j3d.Leaf | +--javax.media.j3d.Fog
The Fog leaf node defines a set of fog parameters common to all types of fog. These parameters include the fog color and a region of influence in which this Fog node is active. A Fog node also contains a list of Group nodes that specifies the hierarchical scope of this Fog. If the scope list is empty, then the Fog node has universe scope: all nodes within the region of influence are affected by this Fog node. If the scope list is non-empty, then only those Leaf nodes under the Group nodes in the scope list are affected by this Fog node (subject to the influencing bounds).
If the regions of influence of multiple Fog nodes overlap, the Java 3D system will choose a single set of fog parameters for those objects that lie in the intersection. This is done in an implementation-dependent manner, but in general, the Fog node that is "closest" to the object is chosen.
Field Summary | |
static int |
ALLOW_COLOR_READ
Specifies that this Fog node allows read access to its color information. |
static int |
ALLOW_COLOR_WRITE
Specifies that this Fog node allows write access to its color information. |
static int |
ALLOW_INFLUENCING_BOUNDS_READ
Specifies that this Fog node allows read access to its influencing bounds and bounds leaf information. |
static int |
ALLOW_INFLUENCING_BOUNDS_WRITE
Specifies that this Fog node allows write access to its influencing bounds and bounds leaf information. |
static int |
ALLOW_SCOPE_READ
Specifies that this Fog node allows read access to its scope information at runtime. |
static int |
ALLOW_SCOPE_WRITE
Specifies that this Fog node allows write access to its scope information at runtime. |
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_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING |
Constructor Summary | |
Fog()
Constructs a Fog node with default parameters. |
|
Fog(Color3f color)
Constructs a Fog node with the specified fog color. |
|
Fog(float r,
float g,
float b)
Constructs a Fog node with the specified fog color. |
Method Summary | |
void |
addScope(Group scope)
Appends the specified Group node to this Fog node's list of scopes. |
java.util.Enumeration |
getAllScopes()
Returns an enumeration of this Fog node's list of scopes. |
void |
getColor(Color3f color)
Retrieves the fog color. |
BoundingLeaf |
getInfluencingBoundingLeaf()
Retrieves the Fog node's influencing bounding leaf. |
Bounds |
getInfluencingBounds()
Retrieves the Fog node's influencing bounds. |
Group |
getScope(int index)
Retrieves the Group node at the specified index from this Fog node's list of scopes. |
int |
indexOfScope(Group scope)
Retrieves the index of the specified Group node in this Fog node's list of scopes. |
void |
insertScope(Group scope,
int index)
Inserts the specified Group node into this Fog node's list of scopes at the specified index. |
int |
numScopes()
Returns the number of nodes in this Fog node's list of scopes. |
void |
removeAllScopes()
Removes all Group nodes from this Fog node's list of scopes. |
void |
removeScope(Group scope)
Removes the specified Group node from this Fog node's list of scopes. |
void |
removeScope(int index)
Removes the node at the specified index from this Fog node's list of scopes. |
void |
setColor(Color3f color)
Sets the fog color to the specified color. |
void |
setColor(float r,
float g,
float b)
Sets the fog color to the specified color. |
void |
setInfluencingBoundingLeaf(BoundingLeaf region)
Sets the Fog's influencing region to the specified bounding leaf. |
void |
setInfluencingBounds(Bounds region)
Sets the Fog's influencing region to the specified bounds. |
void |
setScope(Group scope,
int index)
Replaces the node at the specified index in this Fog node's list of scopes with the specified Group node. |
void |
updateNodeReferences(NodeReferenceTable referenceTable)
Callback used to allow a node to check if any nodes referenced by that node have been duplicated via a call to cloneTree . |
Methods inherited from class javax.media.j3d.Node |
cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable |
Methods inherited from class javax.media.j3d.SceneGraphObject |
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setUserData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ALLOW_INFLUENCING_BOUNDS_READ
public static final int ALLOW_INFLUENCING_BOUNDS_WRITE
public static final int ALLOW_COLOR_READ
public static final int ALLOW_COLOR_WRITE
public static final int ALLOW_SCOPE_READ
public static final int ALLOW_SCOPE_WRITE
Constructor Detail |
public Fog()
public Fog(Color3f color)
color
- the fog colorpublic Fog(float r, float g, float b)
r
- the red component of the fog colorg
- the green component of the fog colorb
- the blue component of the fog colorMethod Detail |
public void setColor(Color3f color)
color
- the new fog color
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setColor(float r, float g, float b)
r
- the red component of the fog colorg
- the green component of the fog colorb
- the blue component of the fog color
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void getColor(Color3f color)
color
- the vector that will receive the current fog color
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setInfluencingBounds(Bounds region)
region
- the bounds that contains the Fog's new influencing region.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic Bounds getInfluencingBounds()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setInfluencingBoundingLeaf(BoundingLeaf region)
region
- the bounding leaf node used to specify the Fog
node's new influencing region.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic BoundingLeaf getInfluencingBoundingLeaf()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void setScope(Group scope, int index)
scope
- the Group node to be stored at the specified index.index
- the index of the Group node to be replaced.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
RestrictedAccessException
- if the specified group node
is part of a compiled scene graphpublic Group getScope(int index)
index
- the index of the Group node to be returned.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void insertScope(Group scope, int index)
scope
- the Group node to be inserted at the specified index.index
- the index at which the Group node is inserted.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
RestrictedAccessException
- if the specified group node
is part of a compiled scene graphpublic void removeScope(int index)
index
- the index of the Group node to be removed.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
RestrictedAccessException
- if the group node at the
specified index is part of a compiled scene graphpublic java.util.Enumeration getAllScopes()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void addScope(Group scope)
scope
- the Group node to be appended.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
RestrictedAccessException
- if the specified group node
is part of a compiled scene graphpublic int numScopes()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic int indexOfScope(Group scope)
scope
- the Group node to be looked up.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graphpublic void removeScope(Group scope)
scope
- the Group node to be removed.
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
RestrictedAccessException
- if the specified group node
is part of a compiled scene graphpublic void removeAllScopes()
CapabilityNotSetException
- if appropriate capability is
not set and this object is part of live or compiled scene graph
RestrictedAccessException
- if any group node in this
node's list of scopes is part of a compiled scene graphpublic void updateNodeReferences(NodeReferenceTable referenceTable)
cloneTree
.
This method is called by cloneTree
after all nodes in
the sub-graph have been duplicated. The cloned Leaf node's method
will be called and the Leaf node can then look up any node references
by using the getNewObjectReference
method found in the
NodeReferenceTable
object. If a match is found, a
reference to the corresponding Node in the newly cloned sub-graph
is returned. If no corresponding reference is found, either a
DanglingReferenceException is thrown or a reference to the original
node is returned depending on the value of the
allowDanglingReferences
parameter passed in the
cloneTree
call.
NOTE: Applications should not call this method directly. It should only be called by the cloneTree method.
updateNodeReferences
in class SceneGraphObject
referenceTable
- a NodeReferenceTableObject that contains the
getNewObjectReference
method needed to search for
new object instances.NodeReferenceTable
,
Node.cloneTree()
,
DanglingReferenceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |