com.jme.scene.state
Class ClipState

java.lang.Object
  extended by com.jme.scene.state.RenderState
      extended by com.jme.scene.state.ClipState
All Implemented Interfaces:
Savable
Direct Known Subclasses:
JOGLClipState, LWJGLClipState

public abstract 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.

Version:
$Id: ClipState.java 4137 2009-03-20 18:38:24Z christoph.luder $
Author:
Joshua Slack

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme.scene.state.RenderState
RenderState.StateType
 
Field Summary
static int CLIP_PLANE0
           
static int CLIP_PLANE1
           
static int CLIP_PLANE2
           
static int CLIP_PLANE3
           
static int CLIP_PLANE4
           
static int CLIP_PLANE5
           
protected  boolean[] enabledClipPlanes
           
static int MAX_CLIP_PLANES
           
protected  double[][] planeEquations
           
 
Fields inherited from class com.jme.scene.state.RenderState
QUICK_COMPARE, RS_BLEND, RS_CLIP, RS_COLORMASK_STATE, RS_CULL, RS_FOG, RS_FRAGMENT_PROGRAM, RS_GLSL_SHADER_OBJECTS, RS_LIGHT, RS_MATERIAL, RS_MAX_STATE, RS_SHADE, RS_STENCIL, RS_TEXTURE, RS_VERTEX_PROGRAM, RS_WIREFRAME, RS_ZBUFFER
 
Constructor Summary
ClipState()
           
 
Method Summary
 java.lang.Class<?> getClassTag()
           
 boolean getPlaneEnabled(int index)
           
 double getPlaneEq(int plane, int eqIndex)
           
 RenderState.StateType getStateType()
          getStateType returns RenderState.StateType.Clip
 int getType()
          Deprecated. As of 2.0, use getStateType() instead.
 void read(JMEImporter e)
           
 void setClipPlaneEquation(int planeIndex, double clipX, double clipY, double clipZ, double clipW)
          Sets plane equation for a specific clip plane
 void setEnableClipPlane(int planeIndex, boolean enabled)
          Enables/disables a specific clip plane
 void setPlaneEq(int plane, int eqIndex, double value)
           
 void write(JMEExporter e)
           
 
Methods inherited from class com.jme.scene.state.RenderState
apply, createStateRecord, extract, isEnabled, needsRefresh, setEnabled, setNeedsRefresh, setQuickCompares
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLIP_PLANE0

public static final int CLIP_PLANE0
See Also:
Constant Field Values

CLIP_PLANE1

public static final int CLIP_PLANE1
See Also:
Constant Field Values

CLIP_PLANE2

public static final int CLIP_PLANE2
See Also:
Constant Field Values

CLIP_PLANE3

public static final int CLIP_PLANE3
See Also:
Constant Field Values

CLIP_PLANE4

public static final int CLIP_PLANE4
See Also:
Constant Field Values

CLIP_PLANE5

public static final int CLIP_PLANE5
See Also:
Constant Field Values

MAX_CLIP_PLANES

public static final int MAX_CLIP_PLANES
See Also:
Constant Field Values

enabledClipPlanes

protected boolean[] enabledClipPlanes

planeEquations

protected double[][] planeEquations
Constructor Detail

ClipState

public ClipState()
Method Detail

getType

public int getType()
Deprecated. As of 2.0, use getStateType() instead.

getType returns RenderState.RS_CLIP

Specified by:
getType in class RenderState
Returns:
RenderState.RS_CLIP
See Also:
RenderState.getType()

getStateType

public RenderState.StateType getStateType()
getStateType returns RenderState.StateType.Clip

Specified by:
getStateType in class RenderState
Returns:
RenderState.StateType.Clip
See Also:
RenderState.getStateType()

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

getPlaneEq

public double getPlaneEq(int plane,
                         int eqIndex)

setPlaneEq

public void setPlaneEq(int plane,
                       int eqIndex,
                       double value)

write

public void write(JMEExporter e)
           throws java.io.IOException
Specified by:
write in interface Savable
Overrides:
write in class RenderState
Throws:
java.io.IOException

read

public void read(JMEImporter e)
          throws java.io.IOException
Specified by:
read in interface Savable
Overrides:
read in class RenderState
Throws:
java.io.IOException

getClassTag

public java.lang.Class<?> getClassTag()
Specified by:
getClassTag in interface Savable
Overrides:
getClassTag in class RenderState