Package com.ardor3d.renderer.state
Class OffsetState
java.lang.Object
com.ardor3d.renderer.state.RenderState
com.ardor3d.renderer.state.OffsetState
- All Implemented Interfaces:
Savable
OffsetState
controls depth offset for rendering.-
Nested Class Summary
Nested classes/interfaces inherited from class com.ardor3d.renderer.state.RenderState
RenderState.StateStack, RenderState.StateType
-
Field Summary
Fields inherited from class com.ardor3d.renderer.state.RenderState
_quickCompare
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfloat
getType()
float
getUnits()
boolean
void
read
(InputCapsule capsule) void
setFactor
(float factor) Sets an offset param to the zbuffer to be used when comparing an incoming fragment for depth buffer pass/fail.void
setTypeEnabled
(OffsetState.OffsetType type, boolean enabled) Enable or disable depth offset for a particular type.void
setUnits
(float units) Sets an offset param to the zbuffer to be used when comparing an incoming fragment for depth buffer pass/fail.void
write
(OutputCapsule capsule) Methods inherited from class com.ardor3d.renderer.state.RenderState
createState, extract, getClassTag, isEnabled, needsRefresh, setEnabled, setNeedsRefresh, setQuickCompares
-
Constructor Details
-
OffsetState
public OffsetState()Constructor instantiates a newOffsetState
object.
-
-
Method Details
-
setFactor
public void setFactor(float factor) Sets an offset param to the zbuffer to be used when comparing an incoming fragment for depth buffer pass/fail.- Parameters:
factor
- Is multiplied by an implementation-specific value to create a constant depth offset. The initial value is 0.
-
getFactor
public float getFactor()- Returns:
- the currently set offset factor.
-
setUnits
public void setUnits(float units) Sets an offset param to the zbuffer to be used when comparing an incoming fragment for depth buffer pass/fail.- Parameters:
units
- Is multiplied by an implementation-specific value to create a constant depth offset. The initial value is 0.
-
getUnits
public float getUnits()- Returns:
- the currently set offset units.
-
setTypeEnabled
Enable or disable depth offset for a particular type.- Parameters:
type
- the type to enable or disableenabled
-true
if the offset is enabled for that type
-
isTypeEnabled
- Parameters:
type
- the type to check- Returns:
- true if offset is enabled for that type. (default is false for all types.)
-
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
-