Package javax.media.j3d
Class ExponentialFog
java.lang.Object
javax.media.j3d.SceneGraphObject
javax.media.j3d.Node
javax.media.j3d.Leaf
javax.media.j3d.Fog
javax.media.j3d.ExponentialFog
The ExponentialFog leaf node extends the Fog leaf node by adding a
fog density that is used as the exponent of the fog equation. The
density is defined in the local coordinate system of the node, but
the actual fog equation will ideally take place in eye coordinates.
The fog blending factor, f, is computed as follows:
-
f = e-(density * z)
where
- z is the distance from the viewpoint.
density is the density of the fog.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Specifies that this ExponentialFog node allows read access to its density information.static final int
Specifies that this ExponentialFog node allows write access to its density information.Fields inherited from class javax.media.j3d.Fog
ALLOW_COLOR_READ, ALLOW_COLOR_WRITE, ALLOW_INFLUENCING_BOUNDS_READ, ALLOW_INFLUENCING_BOUNDS_WRITE, ALLOW_SCOPE_READ, ALLOW_SCOPE_WRITE
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
ConstructorsConstructorDescriptionConstructs an ExponentialFog node with default parameters.ExponentialFog
(float r, float g, float b) Constructs an ExponentialFog node with the specified fog color.ExponentialFog
(float r, float g, float b, float density) Constructs an ExponentialFog node with the specified fog color and density.ExponentialFog
(javax.vecmath.Color3f color) Constructs an ExponentialFog node with the specified fog color.ExponentialFog
(javax.vecmath.Color3f color, float density) Constructs an ExponentialFog node with the specified fog color and density. -
Method Summary
Modifier and TypeMethodDescriptioncloneNode
(boolean forceDuplicate) Used to create a new instance of the node.float
Gets fog density.void
setDensity
(float density) Sets fog density.Methods inherited from class javax.media.j3d.Fog
addScope, getAllScopes, getColor, getInfluencingBoundingLeaf, getInfluencingBounds, getScope, indexOfScope, insertScope, numScopes, removeAllScopes, removeScope, removeScope, setColor, setColor, setInfluencingBoundingLeaf, setInfluencingBounds, setScope, updateNodeReferences
Methods inherited from class javax.media.j3d.Node
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
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString
-
Field Details
-
ALLOW_DENSITY_READ
public static final int ALLOW_DENSITY_READSpecifies that this ExponentialFog node allows read access to its density information.- See Also:
-
ALLOW_DENSITY_WRITE
public static final int ALLOW_DENSITY_WRITESpecifies that this ExponentialFog node allows write access to its density information.- See Also:
-
-
Constructor Details
-
ExponentialFog
public ExponentialFog()Constructs an ExponentialFog node with default parameters. The default values are as follows:-
density : 1.0
-
ExponentialFog
public ExponentialFog(javax.vecmath.Color3f color) Constructs an ExponentialFog node with the specified fog color.- Parameters:
color
- the fog color
-
ExponentialFog
public ExponentialFog(javax.vecmath.Color3f color, float density) Constructs an ExponentialFog node with the specified fog color and density.- Parameters:
color
- the fog colordensity
- the density of the fog
-
ExponentialFog
public ExponentialFog(float r, float g, float b) Constructs an ExponentialFog node with the specified fog color.- Parameters:
r
- the red component of the fog colorg
- the green component of the fog colorb
- the blue component of the fog color
-
ExponentialFog
public ExponentialFog(float r, float g, float b, float density) Constructs an ExponentialFog node with the specified fog color and density.- Parameters:
r
- the red component of the fog colorg
- the green component of the fog colorb
- the blue component of the fog colordensity
- the density of the fog
-
-
Method Details
-
setDensity
public void setDensity(float density) Sets fog density.- Parameters:
density
- the new density of this fog- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
getDensity
public float getDensity()Gets fog density.- Returns:
- the density of this fog
- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
cloneNode
Used to create a new instance of the node. This routine is called bycloneTree
to duplicate the current node.
-