Class WireframeState

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

public class WireframeState extends RenderState
WireframeState maintains whether a node and its children should be drawn in wireframe or solid fill. By default all nodes are rendered solid.
  • Field Details

    • _face

      protected WireframeState.Face _face
      Default wireframe of front and back.
    • _lineWidth

      protected float _lineWidth
      Default line width of 1 pixel.
    • _antialiased

      protected boolean _antialiased
      Default line style
  • Constructor Details

    • WireframeState

      public WireframeState()
  • Method Details

    • getType

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

      public void setLineWidth(float width)
      setLineWidth sets the width of lines the wireframe is drawn in. Attempting to set a line width smaller than 0.0 throws an IllegalArgumentException.
      Parameters:
      width - the line width, in pixels
    • getLineWidth

      public float getLineWidth()
      Returns the current lineWidth.
      Returns:
      the current LineWidth
    • setFace

      public void setFace(WireframeState.Face face)
      setFace sets which face will recieve the wireframe.
      Parameters:
      face - which face will be rendered in wireframe.
      Throws:
      IllegalArgumentException - if face is null
    • getFace

      public WireframeState.Face getFace()
      Returns the face state of this wireframe state.
      Returns:
      The face state (one of WS_FRONT, WS_BACK, or WS_FRONT_AND_BACK)
    • setAntialiased

      public void setAntialiased(boolean antialiased)
      Set whether this wireframe should use antialiasing when drawing lines. May decrease performance. If you want to enabled antialiasing, you should also use an alphastate with a source of SourceFunction.SourceAlpha and a destination of DB_ONE_MINUS_SRC_ALPHA or DB_ONE.
      Parameters:
      antialiased - true for using smoothed antialiased lines.
    • isAntialiased

      public boolean isAntialiased()
      Returns:
      whether this wireframe uses antialiasing for drawing lines.
    • 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