Class ClipState

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

public class ClipState extends RenderState
ClipState specifies a plane to test for clipping of the nodes. This can be used to take "slices" out of geometric objects. ClipPlane can add an additional (to the normal frustum planes) six planes to clip against.
  • Field Details

    • MAX_CLIP_PLANES

      public static final int MAX_CLIP_PLANES
      Max supported number of user-defined clip planes in Ardor3D. Note that a user may or may not have access to all 6 (or even any!) or their particular platform. Check ContextCapabilities to confirm as necessary.
      See Also:
    • enabledClipPlanes

      protected boolean[] enabledClipPlanes
    • planeEquations

      protected double[][] planeEquations
  • Constructor Details

    • ClipState

      public ClipState()
  • Method Details

    • getType

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

      public void setEnableClipPlane(int planeIndex, boolean enabled)
      Enables/disables a specific clip plane
      Parameters:
      planeIndex - Plane to enable/disable (CLIP_PLANE0-CLIP_PLANE5)
      enabled - true/false
    • setClipPlaneEquation

      public void setClipPlaneEquation(int planeIndex, double clipX, double clipY, double clipZ, double clipW)
      Sets plane equation for a specific clip plane
      Parameters:
      planeIndex - Plane to set equation for (CLIP_PLANE0-CLIP_PLANE5)
      clipX - plane x variable
      clipY - plane y variable
      clipZ - plane z variable
      clipW - plane w variable
    • getPlaneEnabled

      public boolean getPlaneEnabled(int index)
      Parameters:
      index - plane to check
      Returns:
      true if given clip plane is enabled
    • getPlaneEquations

      public double[] getPlaneEquations(int plane)
    • getPlaneEquation

      public double getPlaneEquation(int plane, int eqIndex)
    • setPlaneEq

      public void setPlaneEq(int plane, int eqIndex, double value)
    • 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