de.jreality.scene
Class Transformation

java.lang.Object
  extended by de.jreality.scene.SceneGraphNode
      extended by de.jreality.scene.Transformation

public class Transformation
extends SceneGraphNode

A simple transformation class which wraps a 4x4 real matrix. Access is read-only. When contained as a field in an instance of SceneGraphComponent, this transformation is applied to any geometry contained in the component as well as to all children.

For generating and manipulating matrices meeting specific constraints (isometries, etc.) see P3, MatrixBuilder and FactoredMatrix.

For other support, see DefaultMatrixSupport.

Author:
Charles Gunn, Steffen Weissman

Constructor Summary
Transformation()
           
Transformation(double[] matrix)
           
Transformation(String name)
           
Transformation(String name, double[] m)
          Generate a new transform with given matrix If m is null, use identity matrix.
Transformation(Transformation t)
          Deprecated. use new Transformation(oldTrafo.getMatrix()) instead
 
Method Summary
 void accept(SceneGraphVisitor v)
          The accept method for a SceneGraphVisitor.
 void addTransformationListener(TransformationListener listener)
           
 double[] getMatrix()
           
 double[] getMatrix(double[] aMatrix)
          Copy the current matrix into aMatrix and return it.
 void multiplyOnLeft(double[] T)
           
 void multiplyOnRight(double[] T)
           
 void removeTransformationListener(TransformationListener listener)
           
 void setMatrix(double[] aMatrix)
          Assign aMatrix to this Transformation.
static void superAccept(Transformation t, SceneGraphVisitor visitor)
           
 
Methods inherited from class de.jreality.scene.SceneGraphNode
getName, getOwner, getThreadSafe, isReadOnly, setName, setOwner, setReadOnly, setThreadSafe, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Transformation

public Transformation(String name,
                      double[] m)
Generate a new transform with given matrix If m is null, use identity matrix.

Parameters:
metric - See Pn.
m -

Transformation

public Transformation(double[] matrix)

Transformation

public Transformation(String name)

Transformation

public Transformation()

Transformation

public Transformation(Transformation t)
Deprecated. use new Transformation(oldTrafo.getMatrix()) instead

A copy constructor.

Parameters:
t -
Method Detail

getMatrix

public double[] getMatrix()
Returns:
a copy of the current matrix

getMatrix

public double[] getMatrix(double[] aMatrix)
Copy the current matrix into aMatrix and return it.

Parameters:
aMatrix -
Returns:
the filled in matrix

setMatrix

public void setMatrix(double[] aMatrix)
Assign aMatrix to this Transformation.

Parameters:
aMatrix -

multiplyOnRight

public void multiplyOnRight(double[] T)

multiplyOnLeft

public void multiplyOnLeft(double[] T)

addTransformationListener

public void addTransformationListener(TransformationListener listener)

removeTransformationListener

public void removeTransformationListener(TransformationListener listener)

superAccept

public static void superAccept(Transformation t,
                               SceneGraphVisitor visitor)

accept

public void accept(SceneGraphVisitor v)
Description copied from class: SceneGraphNode
The accept method for a SceneGraphVisitor.

Overrides:
accept in class SceneGraphNode