com.jme.scene.state
Class ZBufferState

java.lang.Object
  extended by com.jme.scene.state.RenderState
      extended by com.jme.scene.state.ZBufferState
All Implemented Interfaces:
Savable
Direct Known Subclasses:
JOGLZBufferState, LWJGLZBufferState

public abstract class ZBufferState
extends RenderState

ZBufferState maintains how the use of the depth buffer is to occur. Depth buffer comparisons are used to evaluate what incoming fragment will be used. This buffer is based on z depth, or distance between the pixel source and the eye.

Version:
$Id: ZBufferState.java 4336 2009-05-03 20:57:01Z christoph.luder $
Author:
Mark Powell, Joshua Slack

Nested Class Summary
static class ZBufferState.TestFunction
           
 
Nested classes/interfaces inherited from class com.jme.scene.state.RenderState
RenderState.StateType
 
Field Summary
protected  ZBufferState.TestFunction function
          Depth function.
protected  boolean writable
          Depth mask is writable or not.
 
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
ZBufferState()
          Constructor instantiates a new ZBufferState object.
 
Method Summary
 java.lang.Class<?> getClassTag()
           
 ZBufferState.TestFunction getFunction()
          getFunction returns the current depth function.
 RenderState.StateType getStateType()
          getStateType returns the type RenderState.StateType.ZBuffer
 int getType()
          Deprecated. As of 2.0, use RenderState.getStateType() instead.
 boolean isWritable()
          isWritable returns if the depth mask is writable or not.
 void read(JMEImporter e)
           
 void setFunction(ZBufferState.TestFunction function)
          setFunction sets the depth function.
 void setWritable(boolean writable)
          setWritable sets the depth mask writable or not.
 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

function

protected ZBufferState.TestFunction function
Depth function.


writable

protected boolean writable
Depth mask is writable or not.

Constructor Detail

ZBufferState

public ZBufferState()
Constructor instantiates a new ZBufferState object. The initial values are TestFunction.LessThan and depth writing on.

Method Detail

getFunction

public ZBufferState.TestFunction getFunction()
getFunction returns the current depth function.

Returns:
the depth function currently used.

setFunction

public void setFunction(ZBufferState.TestFunction function)
setFunction sets the depth function.

Parameters:
function - the depth function.
Throws:
java.lang.IllegalArgumentException - if function is null

isWritable

public boolean isWritable()
isWritable returns if the depth mask is writable or not.

Returns:
true if the depth mask is writable, false otherwise.

setWritable

public void setWritable(boolean writable)
setWritable sets the depth mask writable or not.

Parameters:
writable - true to turn on depth writing, false otherwise.

getType

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

getType returns the type of renderstate this is. (RS_ZBUFFER).

Specified by:
getType in class RenderState
Returns:
An int identifying this render state.
See Also:
RenderState.getType()

getStateType

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

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

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