Class FogState

java.lang.Object
com.ardor3d.renderer.state.RenderState
com.ardor3d.renderer.state.FogState
All Implemented Interfaces:
Savable

public class FogState extends RenderState
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.
  • Field Details

  • Constructor Details

    • FogState

      public FogState()
      Constructor instantiates a new FogState with default fog values.
  • Method Details

    • setQuality

      public void setQuality(FogState.Quality quality)
      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

      public void setDensityFunction(FogState.DensityFunction function)
      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

      public void setColor(ReadOnlyColorRGBA color)
      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

      public void setSource(FogState.CoordinateSource source)
    • getSource

      public FogState.CoordinateSource getSource()
    • getType

      public RenderState.StateType getType()
      Specified by:
      getType in class RenderState
      Returns:
      An statetype enum value for the subclass.
      See Also:
    • getQuality

      public FogState.Quality getQuality()
    • getColor

      public ReadOnlyColorRGBA getColor()
    • getDensity

      public float getDensity()
    • getDensityFunction

      public FogState.DensityFunction getDensityFunction()
    • getEnd

      public float getEnd()
    • getStart

      public float getStart()
    • write

      public void write(OutputCapsule capsule) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class RenderState
      Throws:
      IOException
    • read

      public void read(InputCapsule capsule) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class RenderState
      Throws:
      IOException
    • createStateRecord

      public StateRecord createStateRecord(ContextCapabilities caps)
      Specified by:
      createStateRecord in class RenderState