com.jme.scene.state
Class CullState

java.lang.Object
  extended by com.jme.scene.state.RenderState
      extended by com.jme.scene.state.CullState
All Implemented Interfaces:
Savable
Direct Known Subclasses:
JOGLCullState, LWJGLCullState

public abstract class CullState
extends RenderState

CullState determins which side of a model will be visible when it is rendered. By default, both sides are visible. Define front as the side that traces its vertexes counter clockwise and back as the side that traces its vertexes clockwise, a side (front or back) can be culled, or not shown when the model is rendered. Instead, the side will be transparent.
Implementations of this class should take note of the flipped culling mode.
NOTE: Any object that is placed in the transparent queue with two sided transparency will not use the cullstate that is attached to it. Instead, using the cullstates necessary for rendering two sided transparency.

Version:
$Id: CullState.java 4336 2009-05-03 20:57:01Z christoph.luder $
Author:
Mark Powell, Joshua Slack, Jack Lindamood (javadoc only), Tijl Houtbeckers (added flipped culling mode)
See Also:
CullState#setFlippedCulling(boolean)

Nested Class Summary
static class CullState.Face
           
static class CullState.PolygonWind
           
 
Nested classes/interfaces inherited from class com.jme.scene.state.RenderState
RenderState.StateType
 
Field Summary
 
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
CullState()
           
 
Method Summary
 java.lang.Class<?> getClassTag()
           
 CullState.Face getCullFace()
           
 CullState.PolygonWind getPolygonWind()
           
 RenderState.StateType getStateType()
          getStateType returns the type RenderState.StateType.Cull
 int getType()
          Deprecated. As of 2.0, use RenderState.getStateType() instead.
 void read(JMEImporter e)
           
 void setCullFace(CullState.Face face)
           
 void setPolygonWind(CullState.PolygonWind windOrder)
           
 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
 

Constructor Detail

CullState

public CullState()
Method Detail

getType

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

getType returns RenderState.RS_CULL

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

getStateType

public RenderState.StateType getStateType()
getStateType returns the type RenderState.StateType.Cull

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

setCullFace

public void setCullFace(CullState.Face face)
Parameters:
face - The new face to cull.

getCullFace

public CullState.Face getCullFace()
Returns:
the currently set face to cull.

setPolygonWind

public void setPolygonWind(CullState.PolygonWind windOrder)
Parameters:
windOrder - The new polygonWind order.

getPolygonWind

public CullState.PolygonWind getPolygonWind()
Returns:
the currently set polygonWind order.

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