net.java.joglutils.msg.elements
Class ModelMatrixElement

java.lang.Object
  extended by net.java.joglutils.msg.elements.Element
      extended by net.java.joglutils.msg.elements.ModelMatrixElement
Direct Known Subclasses:
GLModelMatrixElement

public class ModelMatrixElement
extends Element

Represents the model matrix, which is the transformation applied to objects in the scene.


Field Summary
protected  Mat4f matrix
           
protected  Mat4f temp
           
 
Constructor Summary
ModelMatrixElement()
           
 
Method Summary
static void enable(State defaultState)
          Enables this element in the passed state, which should be the default for a given action.
static ModelMatrixElement getInstance(State state)
          Returns the instance of this element in the passed State.
 Mat4f getMatrix()
          Returns the current model matrix; callers should not mutate this directly but instead use the accessor methods to change it.
 StateIndex getStateIndex()
          All concrete element subclasses must register themselves with the State in order to reserve a slot, or index, in the state.
static boolean isEnabled(State state)
          Indicates whether this element is enabled in the given default state for a particular action.
 void makeEltIdent()
          Sets this element to the identity matrix.
static void makeIdent(State state)
          Sets the current element to the identity matrix.
static void mult(State state, Mat4f matrix)
          Multiplies the current element by the given matrix.
 void multElt(Mat4f matrix)
          Multiplies this element by the given matrix.
 Element newInstance()
          Creates a new instance initialized to the default values for the state element.
 void push(State state)
          Pushes the element, allowing for side effects to occur.
 
Methods inherited from class net.java.joglutils.msg.elements.Element
getDepth, getNext, getNextInStack, pop, setDepth, setNext, setNextInStack
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

matrix

protected Mat4f matrix

temp

protected Mat4f temp
Constructor Detail

ModelMatrixElement

public ModelMatrixElement()
Method Detail

getStateIndex

public StateIndex getStateIndex()
Description copied from class: Element
All concrete element subclasses must register themselves with the State in order to reserve a slot, or index, in the state. This method must be overridden to return this slot.

Specified by:
getStateIndex in class Element

newInstance

public Element newInstance()
Description copied from class: Element
Creates a new instance initialized to the default values for the state element. All concrete Element subclasses must implement this operation.

Specified by:
newInstance in class Element

getInstance

public static ModelMatrixElement getInstance(State state)
Returns the instance of this element in the passed State.


enable

public static void enable(State defaultState)
Enables this element in the passed state, which should be the default for a given action.


isEnabled

public static boolean isEnabled(State state)
Indicates whether this element is enabled in the given default state for a particular action.


push

public void push(State state)
Description copied from class: Element
Pushes the element, allowing for side effects to occur. Default method does nothing.

Overrides:
push in class Element

getMatrix

public Mat4f getMatrix()
Returns the current model matrix; callers should not mutate this directly but instead use the accessor methods to change it.


makeIdent

public static void makeIdent(State state)
Sets the current element to the identity matrix.


makeEltIdent

public void makeEltIdent()
Sets this element to the identity matrix.


mult

public static void mult(State state,
                        Mat4f matrix)
Multiplies the current element by the given matrix.


multElt

public void multElt(Mat4f matrix)
Multiplies this element by the given matrix.