|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.scene.state.RenderState
com.jme.scene.state.FogState
public abstract class FogState
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 | |
---|---|
static class |
FogState.CoordinateSource
|
static class |
FogState.DensityFunction
|
static class |
FogState.Quality
|
Nested classes/interfaces inherited from class com.jme.scene.state.RenderState |
---|
RenderState.StateType |
Field Summary | |
---|---|
protected ColorRGBA |
color
|
protected float |
density
|
protected FogState.DensityFunction |
densityFunction
|
protected float |
end
|
protected FogState.Quality |
quality
|
protected FogState.CoordinateSource |
source
|
protected float |
start
|
protected static boolean |
supportsFogCoords
True if per vertex fog coords are supported. |
protected static boolean |
supportsFogCoordsDetected
|
Fields inherited from class com.jme.scene.state.RenderState |
---|
QUICK_COMPARE, RS_BLEND, RS_CLIP, RS_COLORMASK_STATE, RS_CULL, RS_FOG, RS_FRAGMENT_PROGRAM, RS_GLSL_SHADER_OBJECTS, RS_LIGHT, RS_MATERIAL, RS_MAX_STATE, RS_SHADE, RS_STENCIL, RS_TEXTURE, RS_VERTEX_PROGRAM, RS_WIREFRAME, RS_ZBUFFER |
Constructor Summary | |
---|---|
FogState()
Constructor instantiates a new FogState with default fog
values. |
Method Summary | |
---|---|
java.lang.Class<? extends FogState> |
getClassTag()
|
ColorRGBA |
getColor()
|
float |
getDensity()
|
FogState.DensityFunction |
getDensityFunction()
|
float |
getEnd()
|
FogState.Quality |
getQuality()
|
FogState.CoordinateSource |
getSource()
|
float |
getStart()
|
RenderState.StateType |
getStateType()
getStateType returns the type RenderState.StateType.Fog |
int |
getType()
Deprecated. As of 2.0, use RenderState.getStateType() instead. |
static boolean |
isFogCoordsSupported()
|
static void |
overrideFogCoordsSupport(boolean use)
Override setting of support for mesh based fog coords. |
void |
read(JMEImporter e)
|
static void |
resetFogCoordsSupport()
Reset support for mesh based fog coords to driver-detected setting. |
void |
setColor(ColorRGBA 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(JMEExporter e)
|
Methods inherited from class com.jme.scene.state.RenderState |
---|
apply, createStateRecord, extract, isEnabled, needsRefresh, setEnabled, setNeedsRefresh, setQuickCompares |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static boolean supportsFogCoords
protected static boolean supportsFogCoordsDetected
protected float start
protected float end
protected float density
protected ColorRGBA color
protected FogState.DensityFunction densityFunction
protected FogState.Quality quality
protected FogState.CoordinateSource source
Constructor Detail |
---|
public FogState()
FogState
with default fog
values.
Method Detail |
---|
public void setQuality(FogState.Quality quality)
setQuality
sets the quality used for the fog attributes.
quality
- the quality used for the fog application.
java.lang.IllegalArgumentException
- if quality is nullpublic void setDensityFunction(FogState.DensityFunction function)
setDensityFunction
sets the density function used for the
fog blending.
function
- the function used for the fog density.
java.lang.IllegalArgumentException
- if function is nullpublic void setColor(ColorRGBA color)
setColor
sets the color of the fog.
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.public void setDensity(float density)
setDensity
sets the density of the fog. This value is
clamped to [0, 1].
density
- the density of the fog.public void setEnd(float end)
setEnd
sets the end distance, or the distance where fog is
at it's thickest.
end
- the distance where the fog is the thickest.public void setStart(float start)
setStart
sets the start distance, or where fog begins to
be applied.
start
- the start distance of the fog.public void setSource(FogState.CoordinateSource source)
public FogState.CoordinateSource getSource()
public int getType()
RenderState.getStateType()
instead.
getType
returns the render state type of the fog state.
(RS_FOG).
getType
in class RenderState
RenderState.getType()
public RenderState.StateType getStateType()
getStateType
returns the type RenderState.StateType.Fog
getStateType
in class RenderState
RenderState.StateType.Fog
RenderState.getStateType()
public FogState.Quality getQuality()
public ColorRGBA getColor()
public float getDensity()
public FogState.DensityFunction getDensityFunction()
public float getEnd()
public float getStart()
public static boolean isFogCoordsSupported()
public static void overrideFogCoordsSupport(boolean use)
use
- public static void resetFogCoordsSupport()
public void write(JMEExporter e) throws java.io.IOException
write
in interface Savable
write
in class RenderState
java.io.IOException
public void read(JMEImporter e) throws java.io.IOException
read
in interface Savable
read
in class RenderState
java.io.IOException
public java.lang.Class<? extends FogState> getClassTag()
getClassTag
in interface Savable
getClassTag
in class RenderState
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |