Class OffsetState

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

public class OffsetState extends RenderState
OffsetState controls depth offset for rendering.
  • Constructor Details

    • OffsetState

      public OffsetState()
      Constructor instantiates a new OffsetState object.
  • Method Details

    • setFactor

      public void setFactor(float factor)
      Sets an offset param to the zbuffer to be used when comparing an incoming fragment for depth buffer pass/fail.
      Parameters:
      factor - Is multiplied by an implementation-specific value to create a constant depth offset. The initial value is 0.
    • getFactor

      public float getFactor()
      Returns:
      the currently set offset factor.
    • setUnits

      public void setUnits(float units)
      Sets an offset param to the zbuffer to be used when comparing an incoming fragment for depth buffer pass/fail.
      Parameters:
      units - Is multiplied by an implementation-specific value to create a constant depth offset. The initial value is 0.
    • getUnits

      public float getUnits()
      Returns:
      the currently set offset units.
    • setTypeEnabled

      public void setTypeEnabled(OffsetState.OffsetType type, boolean enabled)
      Enable or disable depth offset for a particular type.
      Parameters:
      type - the type to enable or disable
      enabled - true if the offset is enabled for that type
    • isTypeEnabled

      public boolean isTypeEnabled(OffsetState.OffsetType type)
      Parameters:
      type - the type to check
      Returns:
      true if offset is enabled for that type. (default is false for all types.)
    • getType

      public RenderState.StateType getType()
      Specified by:
      getType in class RenderState
      Returns:
      An statetype enum value for the subclass.
      See Also:
    • 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