com.jme.scene.state
Class ZBufferState

java.lang.Object
  extended bycom.jme.scene.state.RenderState
      extended bycom.jme.scene.state.ZBufferState
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
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,v 1.3 2004/08/02 21:15:13 cep21 Exp $
Author:
Mark Powell
See Also:
Serialized Form

Field Summary
static int CF_ALWAYS
          Depth comparison always passes.
static int CF_EQUAL
          Passes if the incoming value is the same as the stored value.
static int CF_GEQUAL
          Passes if the incoming value is greater than or equal to the stored value.
static int CF_GREATER
          Passes if the incoming value is greater than the stored value.
static int CF_LEQUAL
          Passes if the incoming value is less than or equal to the stored value.
static int CF_LESS
          Passes if the incoming value is less than the stored value.
static int CF_NEVER
          Depth comparison never passes.
static int CF_NOTEQUAL
          Passes if the incoming value is not equal to the stored value.
protected  int function
          Depth function.
protected  boolean writable
          Depth mask is writable or not.
 
Fields inherited from class com.jme.scene.state.RenderState
RS_ALPHA, RS_ATTRIBUTE, RS_CULL, RS_DITHER, 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
 int getFunction()
          getFunction returns the current depth function.
 int getType()
          getType returns the type of renderstate this is.
 boolean isWritable()
          isWritable returns if the depth mask is writable or not.
 void setFunction(int function)
          setFunction sets the depth function.
 void setWritable(boolean writable)
          setWritable sets the depth mask writable or not.
 
Methods inherited from class com.jme.scene.state.RenderState
apply, extract, isEnabled, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CF_NEVER

public static final int CF_NEVER
Depth comparison never passes.

See Also:
Constant Field Values

CF_LESS

public static final int CF_LESS
Passes if the incoming value is less than the stored value.

See Also:
Constant Field Values

CF_EQUAL

public static final int CF_EQUAL
Passes if the incoming value is the same as the stored value.

See Also:
Constant Field Values

CF_LEQUAL

public static final int CF_LEQUAL
Passes if the incoming value is less than or equal to the stored value.

See Also:
Constant Field Values

CF_GREATER

public static final int CF_GREATER
Passes if the incoming value is greater than the stored value.

See Also:
Constant Field Values

CF_NOTEQUAL

public static final int CF_NOTEQUAL
Passes if the incoming value is not equal to the stored value.

See Also:
Constant Field Values

CF_GEQUAL

public static final int CF_GEQUAL
Passes if the incoming value is greater than or equal to the stored value.

See Also:
Constant Field Values

CF_ALWAYS

public static final int CF_ALWAYS
Depth comparison always passes.

See Also:
Constant Field Values

function

protected int 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 CF_LESS and depth writing on.

Method Detail

getFunction

public int getFunction()
getFunction returns the current depth function.

Returns:
the depth function currently used.

setFunction

public void setFunction(int function)
setFunction sets the depth function. If an invalid value is passed, CF_LESS is used.

Parameters:
function - the depth function.

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()
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()