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 ClassesNested classes/interfaces inherited from class com.ardor3d.renderer.state.RenderState
RenderState.StateStack, RenderState.StateType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ZBufferState.TestFunctionDepth function.protected booleanDepth mask is writable or not.Fields inherited from class com.ardor3d.renderer.state.RenderState
_quickCompare -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFunctionreturns the current depth function.getType()booleanisWritablereturns if the depth mask is writable or not.voidread(InputCapsule capsule) voidsetFunction(ZBufferState.TestFunction function) setFunctionsets the depth function.voidsetWritable(boolean writable) setWritablesets the depth mask writable or not.voidwrite(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 newZBufferStateobject. The initial values are TestFunction.LessThan and depth writing on.
-
-
Method Details
-
getFunction
getFunctionreturns the current depth function.- Returns:
- the depth function currently used.
-
setFunction
setFunctionsets the depth function.- Parameters:
function- the depth function.- Throws:
IllegalArgumentException- if function is null
-
isWritable
public boolean isWritable()isWritablereturns if the depth mask is writable or not.- Returns:
- true if the depth mask is writable, false otherwise.
-
setWritable
public void setWritable(boolean writable) setWritablesets the depth mask writable or not.- Parameters:
writable- true to turn on depth writing, false otherwise.
-
getType
- Specified by:
getTypein classRenderState- Returns:
- An statetype enum value for the subclass.
- See Also:
-
write
- Specified by:
writein interfaceSavable- Overrides:
writein classRenderState- Throws:
IOException
-
read
- Specified by:
readin interfaceSavable- Overrides:
readin classRenderState- Throws:
IOException
-
createStateRecord
- Specified by:
createStateRecordin classRenderState
-