com.threerings.opengl.renderer.state
Class FogState

java.lang.Object
  extended by com.threerings.opengl.renderer.state.RenderState
      extended by com.threerings.opengl.renderer.state.FogState

public class FogState
extends RenderState

Contains the fog state.


Field Summary
protected  Color4f _fogColor
          The fog color.
protected  float _fogDensity
          The fog density.
protected  float _fogEnd
          The fog end distance.
protected  int _fogMode
          The fog mode (or -1 if disabled).
protected  float _fogStart
          The fog start distance.
static FogState DISABLED
          A state that disables the fog.
 
Fields inherited from class com.threerings.opengl.renderer.state.RenderState
_defaults, _dirty, ALPHA_STATE, ARRAY_STATE, COLOR_MASK_STATE, COLOR_STATE, CULL_STATE, DEPTH_STATE, FOG_STATE, LIGHT_STATE, LINE_STATE, MATERIAL_STATE, POINT_STATE, POLYGON_STATE, SHADER_STATE, STATE_COUNT, STENCIL_STATE, TEXTURE_STATE, TRANSFORM_STATE
 
Constructor Summary
FogState(int fogMode, float fogDensity, Color4f fogColor)
          Creates a new fog state.
FogState(int fogMode, float fogStart, float fogEnd, Color4f fogColor)
          Creates a new linear fog state.
 
Method Summary
 void apply(Renderer renderer)
          Applies this state.
 Color4f getFogColor()
          Returns a reference to the fog color.
 float getFogDensity()
          Returns the fog density.
 float getFogEnd()
          Returns the fog end distance.
 int getFogMode()
          Returns the fog mode.
 float getFogStart()
          Returns the fog start distance.
 int getType()
          Returns the type of this state.
 
Methods inherited from class com.threerings.opengl.renderer.state.RenderState
copy, createDefaultSet, createEmptySet, getDefaults, isDirty, setDirty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DISABLED

public static final FogState DISABLED
A state that disables the fog.


_fogMode

protected int _fogMode
The fog mode (or -1 if disabled).


_fogDensity

protected float _fogDensity
The fog density.


_fogStart

protected float _fogStart
The fog start distance.


_fogEnd

protected float _fogEnd
The fog end distance.


_fogColor

protected Color4f _fogColor
The fog color.

Constructor Detail

FogState

public FogState(int fogMode,
                float fogDensity,
                Color4f fogColor)
Creates a new fog state.


FogState

public FogState(int fogMode,
                float fogStart,
                float fogEnd,
                Color4f fogColor)
Creates a new linear fog state.

Method Detail

getFogMode

public int getFogMode()
Returns the fog mode.


getFogDensity

public float getFogDensity()
Returns the fog density.


getFogStart

public float getFogStart()
Returns the fog start distance.


getFogEnd

public float getFogEnd()
Returns the fog end distance.


getFogColor

public Color4f getFogColor()
Returns a reference to the fog color.


getType

public int getType()
Description copied from class: RenderState
Returns the type of this state.

Specified by:
getType in class RenderState

apply

public void apply(Renderer renderer)
Description copied from class: RenderState
Applies this state.

Specified by:
apply in class RenderState