Package com.ardor3d.renderer.state
Class FogState
java.lang.Object
com.ardor3d.renderer.state.RenderState
com.ardor3d.renderer.state.FogState
- All Implemented Interfaces:
Savable
FogState
maintains the fog qualities for a node and it's children. The fogging function, color, start,
end and density are all set and maintained. Please note that fog does not affect alpha.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static enum
static enum
Nested classes/interfaces inherited from class com.ardor3d.renderer.state.RenderState
RenderState.StateStack, RenderState.StateType
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ColorRGBA
protected float
protected FogState.DensityFunction
protected float
protected FogState.Quality
protected FogState.CoordinateSource
protected float
Fields inherited from class com.ardor3d.renderer.state.RenderState
_quickCompare
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetColor()
float
float
getEnd()
float
getStart()
getType()
void
read
(InputCapsule capsule) void
setColor
(ReadOnlyColorRGBA color) setColor
sets the color of the fog.void
setDensity
(float density) setDensity
sets the density of the fog.void
setDensityFunction
(FogState.DensityFunction function) setDensityFunction
sets the density function used for the fog blending.void
setEnd
(float end) setEnd
sets the end distance, or the distance where fog is at it's thickest.void
setQuality
(FogState.Quality quality) setQuality
sets the quality used for the fog attributes.void
setSource
(FogState.CoordinateSource source) void
setStart
(float start) setStart
sets the start distance, or where fog begins to be applied.void
write
(OutputCapsule capsule) Methods inherited from class com.ardor3d.renderer.state.RenderState
createState, extract, getClassTag, isEnabled, needsRefresh, setEnabled, setNeedsRefresh, setQuickCompares
-
Field Details
-
start
protected float start -
end
protected float end -
density
protected float density -
color
-
densityFunction
-
quality
-
source
-
-
Constructor Details
-
FogState
public FogState()Constructor instantiates a newFogState
with default fog values.
-
-
Method Details
-
setQuality
setQuality
sets the quality used for the fog attributes.- Parameters:
quality
- the quality used for the fog application.- Throws:
IllegalArgumentException
- if quality is null
-
setDensityFunction
setDensityFunction
sets the density function used for the fog blending.- Parameters:
function
- the function used for the fog density.- Throws:
IllegalArgumentException
- if function is null
-
setColor
setColor
sets the color of the fog.- Parameters:
color
- the color of the fog. This value is COPIED into the state. Further changes to the object after calling this method will have no affect on this state.
-
setDensity
public void setDensity(float density) setDensity
sets the density of the fog. This value is clamped to [0, 1].- Parameters:
density
- the density of the fog.
-
setEnd
public void setEnd(float end) setEnd
sets the end distance, or the distance where fog is at it's thickest.- Parameters:
end
- the distance where the fog is the thickest.
-
setStart
public void setStart(float start) setStart
sets the start distance, or where fog begins to be applied.- Parameters:
start
- the start distance of the fog.
-
setSource
-
getSource
-
getType
- Specified by:
getType
in classRenderState
- Returns:
- An statetype enum value for the subclass.
- See Also:
-
getQuality
-
getColor
-
getDensity
public float getDensity() -
getDensityFunction
-
getEnd
public float getEnd() -
getStart
public float getStart() -
write
- Specified by:
write
in interfaceSavable
- Overrides:
write
in classRenderState
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classRenderState
- Throws:
IOException
-
createStateRecord
- Specified by:
createStateRecord
in classRenderState
-