Package com.ardor3d.renderer.state
Class ClipState
java.lang.Object
com.ardor3d.renderer.state.RenderState
com.ardor3d.renderer.state.ClipState
- All Implemented Interfaces:
Savable
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.-
Nested Class Summary
Nested classes/interfaces inherited from class com.ardor3d.renderer.state.RenderState
RenderState.StateStack, RenderState.StateType
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean[]
static final int
Max supported number of user-defined clip planes in Ardor3D.protected double[][]
Fields inherited from class com.ardor3d.renderer.state.RenderState
_quickCompare
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
getPlaneEnabled
(int index) double
getPlaneEquation
(int plane, int eqIndex) double[]
getPlaneEquations
(int plane) getType()
void
read
(InputCapsule capsule) void
setClipPlaneEquation
(int planeIndex, double clipX, double clipY, double clipZ, double clipW) Sets plane equation for a specific clip planevoid
setEnableClipPlane
(int planeIndex, boolean enabled) Enables/disables a specific clip planevoid
setPlaneEq
(int plane, int eqIndex, double value) void
write
(OutputCapsule capsule) Methods inherited from class com.ardor3d.renderer.state.RenderState
createState, extract, getClassTag, isEnabled, needsRefresh, setEnabled, setNeedsRefresh, setQuickCompares
-
Field Details
-
MAX_CLIP_PLANES
public static final int MAX_CLIP_PLANESMax 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
- Specified by:
getType
in classRenderState
- 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 variableclipY
- plane y variableclipZ
- plane z variableclipW
- 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
- Specified by:
write
in interfaceSavable
- Overrides:
write
in classRenderState
- Throws:
IOException
-
read
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classRenderState
- Throws:
IOException
-
createStateRecord
- Specified by:
createStateRecord
in classRenderState
-