Package com.ardor3d.renderer.state
Class ZBufferState
java.lang.Object
com.ardor3d.renderer.state.RenderState
com.ardor3d.renderer.state.ZBufferState
- All Implemented Interfaces:
Savable
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.-
Nested Class Summary
Nested classes/interfaces inherited from class com.ardor3d.renderer.state.RenderState
RenderState.StateStack, RenderState.StateType
-
Field Summary
Modifier and TypeFieldDescriptionprotected ZBufferState.TestFunction
Depth function.protected boolean
Depth mask is writable or not.Fields inherited from class com.ardor3d.renderer.state.RenderState
_quickCompare
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetFunction
returns the current depth function.getType()
boolean
isWritable
returns if the depth mask is writable or not.void
read
(InputCapsule capsule) void
setFunction
(ZBufferState.TestFunction function) setFunction
sets the depth function.void
setWritable
(boolean writable) setWritable
sets the depth mask writable or not.void
write
(OutputCapsule capsule) Methods inherited from class com.ardor3d.renderer.state.RenderState
createState, extract, getClassTag, isEnabled, needsRefresh, setEnabled, setNeedsRefresh, setQuickCompares
-
Field Details
-
_function
Depth function. -
_writable
protected boolean _writableDepth mask is writable or not.
-
-
Constructor Details
-
ZBufferState
public ZBufferState()Constructor instantiates a newZBufferState
object. The initial values are TestFunction.LessThan and depth writing on.
-
-
Method Details
-
getFunction
getFunction
returns the current depth function.- Returns:
- the depth function currently used.
-
setFunction
setFunction
sets the depth function.- Parameters:
function
- the depth function.- Throws:
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
- Specified by:
getType
in classRenderState
- Returns:
- An statetype enum value for the subclass.
- See Also:
-
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
-