com.jme.scene
Class PassNodeState

java.lang.Object
  extended by com.jme.scene.PassNodeState
All Implemented Interfaces:
Savable, java.io.Serializable

public class PassNodeState
extends java.lang.Object
implements Savable, java.io.Serializable

PassNodeState Creator: rikard.herlitz, 2007-maj-10

See Also:
Serialized Form

Field Summary
protected  boolean enabled
          if false, pass will not be updated or rendered.
protected  RenderState[] passStates
          RenderStates registered with this pass - if a given state is not null it overrides the corresponding state set during rendering.
protected  RenderState[] savedStates
          a place to internally save previous states setup before rendering this pass
protected  float zFactor
          offset params to use to differentiate multiple passes of the same scene in the zbuffer.
protected  float zOffset
           
 
Constructor Summary
PassNodeState()
           
 
Method Summary
 void applyPassNodeState(Renderer r, RenderContext<?> context)
          Applies all currently set renderstates and z offset parameters to the supplied context
protected  void applyPassStates(RenderContext<?> context)
          Applies all currently set renderstates to the supplied context
 void clearPassState(int renderStateType)
          Deprecated. As of 2.0, use clearPassState(com.jme.scene.state.RenderState.StateType) instead.
 void clearPassState(RenderState.StateType type)
          Clears an enforced render state by setting it to null.
 void clearPassStates()
          sets all enforced states to null.
 java.lang.Class<?> getClassTag()
           
 RenderState getPassState(int renderStateType)
          Deprecated. As of 2.0, use getPassState(com.jme.scene.state.RenderState.StateType) instead.
 RenderState getPassState(RenderState.StateType type)
          Returns the RenderState of the given type.
 float getZFactor()
           
 float getZOffset()
           
 boolean isEnabled()
           
 void read(JMEImporter e)
           
protected  void resetOldStates(RenderContext<?> context)
          Resets all renderstates on the supplied context
 void resetPassNodeStates(Renderer r, RenderContext<?> context)
          Resets currently set renderstates and z offset parameters on the supplied context
 void setEnabled(boolean enabled)
           
 void setPassState(RenderState state)
          Enforce a particular state.
 void setZFactor(float factor)
          Sets the polygon offset param - factor - for this Pass.
 void setZOffset(float offset)
          Sets the polygon offset param - offset - for this Pass.
 void write(JMEExporter e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enabled

protected boolean enabled
if false, pass will not be updated or rendered.


zFactor

protected float zFactor
offset params to use to differentiate multiple passes of the same scene in the zbuffer.


zOffset

protected float zOffset

passStates

protected RenderState[] passStates
RenderStates registered with this pass - if a given state is not null it overrides the corresponding state set during rendering.


savedStates

protected RenderState[] savedStates
a place to internally save previous states setup before rendering this pass

Constructor Detail

PassNodeState

public PassNodeState()
Method Detail

applyPassNodeState

public void applyPassNodeState(Renderer r,
                               RenderContext<?> context)
Applies all currently set renderstates and z offset parameters to the supplied context

Parameters:
r -
context -

resetPassNodeStates

public void resetPassNodeStates(Renderer r,
                                RenderContext<?> context)
Resets currently set renderstates and z offset parameters on the supplied context

Parameters:
r -
context -

setPassState

public void setPassState(RenderState state)
Enforce a particular state. In other words, the given state will override any state of the same type set on a scene object. Remember to clear the state when done enforcing. Very useful for multipass techniques where multiple sets of states need to be applied to a scenegraph drawn multiple times.

Parameters:
state - state to enforce

getPassState

public RenderState getPassState(int renderStateType)
Deprecated. As of 2.0, use getPassState(com.jme.scene.state.RenderState.StateType) instead.

Parameters:
renderStateType - the type to query
Returns:
the state enforced for a give state type, or null if none.

getPassState

public RenderState getPassState(RenderState.StateType type)
Returns the RenderState of the given type.

Parameters:
type - the type to query
Returns:
the RenderState enforced for a given state type, or null if none.

clearPassState

public void clearPassState(int renderStateType)
Deprecated. As of 2.0, use clearPassState(com.jme.scene.state.RenderState.StateType) instead.

Clears an enforced render state index by setting it to null. This allows object specific states to be used.

Parameters:
renderStateType - The type of RenderState to clear enforcement on.

clearPassState

public void clearPassState(RenderState.StateType type)
Clears an enforced render state by setting it to null. This allows object specific states to be used.

Parameters:
type - The type of RenderState to clear enforcement on.

clearPassStates

public void clearPassStates()
sets all enforced states to null.

See Also:
RenderContext.clearEnforcedState(int)

applyPassStates

protected void applyPassStates(RenderContext<?> context)
Applies all currently set renderstates to the supplied context

Parameters:
context -

resetOldStates

protected void resetOldStates(RenderContext<?> context)
Resets all renderstates on the supplied context

Parameters:
context -

isEnabled

public boolean isEnabled()
Returns:
Returns the enabled.

setEnabled

public void setEnabled(boolean enabled)
Parameters:
enabled - The enabled to set.

getZFactor

public float getZFactor()
Returns:
Returns the zFactor.

setZFactor

public void setZFactor(float factor)
Sets the polygon offset param - factor - for this Pass.

Parameters:
factor - The zFactor to set.

getZOffset

public float getZOffset()
Returns:
Returns the zOffset.

setZOffset

public void setZOffset(float offset)
Sets the polygon offset param - offset - for this Pass.

Parameters:
offset - The zOffset to set.

getClassTag

public java.lang.Class<?> getClassTag()
Specified by:
getClassTag in interface Savable

write

public void write(JMEExporter e)
           throws java.io.IOException
Specified by:
write in interface Savable
Throws:
java.io.IOException

read

public void read(JMEImporter e)
          throws java.io.IOException
Specified by:
read in interface Savable
Throws:
java.io.IOException