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
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumNested classes/interfaces inherited from class com.ardor3d.renderer.state.RenderState
RenderState.StateStack, RenderState.StateType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ColorRGBAprotected floatprotected FogState.DensityFunctionprotected floatprotected FogState.Qualityprotected FogState.CoordinateSourceprotected floatFields inherited from class com.ardor3d.renderer.state.RenderState
_quickCompare -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetColor()floatfloatgetEnd()floatgetStart()getType()voidread(InputCapsule capsule) voidsetColor(ReadOnlyColorRGBA color) setColorsets the color of the fog.voidsetDensity(float density) setDensitysets the density of the fog.voidsetDensityFunction(FogState.DensityFunction function) setDensityFunctionsets the density function used for the fog blending.voidsetEnd(float end) setEndsets the end distance, or the distance where fog is at it's thickest.voidsetQuality(FogState.Quality quality) setQualitysets the quality used for the fog attributes.voidsetSource(FogState.CoordinateSource source) voidsetStart(float start) setStartsets the start distance, or where fog begins to be applied.voidwrite(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 newFogStatewith default fog values.
-
-
Method Details
-
setQuality
setQualitysets the quality used for the fog attributes.- Parameters:
quality- the quality used for the fog application.- Throws:
IllegalArgumentException- if quality is null
-
setDensityFunction
setDensityFunctionsets the density function used for the fog blending.- Parameters:
function- the function used for the fog density.- Throws:
IllegalArgumentException- if function is null
-
setColor
setColorsets 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) setDensitysets 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) setEndsets 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) setStartsets the start distance, or where fog begins to be applied.- Parameters:
start- the start distance of the fog.
-
setSource
-
getSource
-
getType
- Specified by:
getTypein 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:
writein interfaceSavable- Overrides:
writein classRenderState- Throws:
IOException
-
read
- Specified by:
readin interfaceSavable- Overrides:
readin classRenderState- Throws:
IOException
-
createStateRecord
- Specified by:
createStateRecordin classRenderState
-