org.jrabbit.base.graphics.transforms
Class GLControlledReset

java.lang.Object
  extended by org.jrabbit.base.graphics.transforms.GLMatrixStackControl
      extended by org.jrabbit.base.graphics.transforms.GLReset
          extended by org.jrabbit.base.graphics.transforms.GLControlledReset
All Implemented Interfaces:
GLTransform

public class GLControlledReset
extends GLReset

A GLControlledReset extends GLReset to provide controls over its affect - that is to say, it only resets/restores the current OpenGL Matrix it is enabled; if not, no changes to OpenGL occur.

Author:
Chris Molini

Field Summary
protected  boolean enabled
          Whether or not the GLControlledReset is enabled.
 
Constructor Summary
GLControlledReset()
           
 
Method Summary
 void bind()
          If enabled, this pushes the current OpenGL Matrix and calls glLoadIdentity().
 boolean enabled()
          Determines if the GLControlledReset is active or not.
 void release()
          If enabled, this pops the current OpenGL Matrix.
 void setEnabled(boolean enabled)
          Changes if the GLControlledReset is enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enabled

protected boolean enabled
Whether or not the GLControlledReset is enabled.

Constructor Detail

GLControlledReset

public GLControlledReset()
Method Detail

enabled

public boolean enabled()
Determines if the GLControlledReset is active or not.

Returns:
True if enabled, false if not.

setEnabled

public void setEnabled(boolean enabled)
Changes if the GLControlledReset is enabled.

Parameters:
enabled - Whether or not this should be active.

bind

public void bind()
If enabled, this pushes the current OpenGL Matrix and calls glLoadIdentity().

Specified by:
bind in interface GLTransform
Overrides:
bind in class GLReset

release

public void release()
If enabled, this pops the current OpenGL Matrix.

Specified by:
release in interface GLTransform
Overrides:
release in class GLMatrixStackControl