Class dnx.geom.Matrix4
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dnx.geom.Matrix4

java.lang.Object
   |
   +----dnx.geom.Matrix4

public class Matrix4
extends Object
implements Cloneable, Copyable
A Matrix4 is a 4x4 matrix.

Constructor Index

 o Matrix4()
Identity matrix constructor.
 o Matrix4(float[])
 o Matrix4(Matrix4)
 o Matrix4(Point3)
 o Matrix4(Quaternion)

Method Index

 o clear()
 o clone()
 o copy(Copyable)
 o decompose(Point3)
Decompose the matrix into a translation.
 o decompose(Quaternion)
Decompose the matrix into a rotation.
 o decompose(Quaternion, Point3)
Decompose the matrix into a rotation and translation.
 o decompose(Quaternion, Point3, Vector3)
Decompose the matrix into a rotation, translation, and scaling.
 o destructiveDecompose(Quaternion, Point3, Vector3)
 o determinant()
Return the determinant of the matrix.
 o doQuatRotate(Quaternion)
 o equals(Matrix4)
 o equals(Object)
 o getElements(float[])
 o getOverallScalingFactor()
Return the overall scaling factor of this matrix.
 o getRows(Vector3, Vector3, Vector3)
 o getRows(Vector3, Vector3, Vector3, Point3)
 o identity()
Load the identity transformation.
 o inverse(Matrix4)
Set the matrix to the inverse of m
 o invert()
Invert the matrix.
 o isAffine()
Return true if the matrix represents a 3D affine transformation.
 o isIdentity()
Return true if the matrix is the identity matrix.
 o isLengthPreserving()
Return true if the matrix represents a length-preserving (rigid) transformation in 3D space.
 o isLinear()
Return true if the matrix represents a 3D linear transformation.
 o multiply(Matrix4, Matrix4)
Set the matrix to the product of matrices m1 and m2
 o optimize()
This method attempts to classify the matrix as a member one of of several special categories so that further computations involving it are more efficient.
 o postMultiply(Matrix4)
Post-multiply with another matrix.
 o preMultiply(Matrix4)
Pre-multiply with another matrix.
 o rotate(float)
2-dimensional rotation (in the xy-plane)
 o rotate(float, float, float, float)
Apply a rotation of angle radians about the origin through the axis (ax, ay, az).
 o rotate(float, float, float, float, float)
Apply a rotation about the origin through the axis (ax, ay, az) of an angle whose cosine and sine are as given.
 o rotate(Matrix4, float)
 o rotate(Matrix4, float, float, float, float)
Set the matrix to the rotation of matrix M through the axis (ax, ay, az) by angle radians.
 o rotate(Matrix4, float, float, float, float, float)
Set the matrix to the rotation of matrix M through the axis (ax, ay, az) by an angle whose cosine and sine are as given.
 o rotate(Matrix4, Quaternion)
 o rotate(Matrix4, Vector3, float)
Set the matrix to the rotation of matrix M by ANGLE radians about the origin through AXIS.
 o rotate(Matrix4, Vector3, float, float)
Set the matrix to the rotation of matrix M about the origin through AXIS by an angle whose cosine and sine are as given.
 o rotate(Quaternion)
Apply the 3D rotation about the origin represented by the unit quaternion q.
 o rotate(Vector3, float)
Apply a rotation of angle radians about the origin through axis.
 o rotate(Vector3, float, float)
Apply a rotation through axis of angle radians about the origin of an angle whose cosine and sine are as given.
 o scale(float)
Scale the matrix isotropically by premultiplying with S(s, s, s)
 o scale(float, float, float)
Scale the matrix by premultiplying with S(sx, sy, sz)
 o scale(Matrix4, float)
Set the matrix to S(s, s, s) M
 o scale(Matrix4, float, float, float)
Set the matrix to S(sx, sy, sz) M
 o scale(Matrix4, Vector3)
Set the matrix to S(v) M
 o scale(Vector3)
Scale the matrix by premultiplying with S(v)
 o setElements(float[])
 o toString()
 o translate(float, float, float)
Translate the matrix by premultiplying with T(dx, dy, dz)
 o translate(Matrix4, float, float, float)
Set the matrix to T(dx, dy, dz) M
 o translate(Matrix4, Point3)
Set the matrix to T(P) M
 o translate(Point3)
Translate the matrix by premultiplying with T(P)
 o transpose()
Compute the transpose of the matrix.
 o transpose(Matrix4)
Set the matrix to the transpose of m.
 o xrotate(float)
X-axis rotation.
 o xrotate(Matrix4, float)
 o yrotate(float)
Y-axis rotation.
 o yrotate(Matrix4, float)
 o zrotate(float)
Z-axis rotation.
 o zrotate(Matrix4, float)

Constructors

 o Matrix4
  public Matrix4()
Identity matrix constructor.
 o Matrix4
  public Matrix4(float m[])
 o Matrix4
  public Matrix4(Quaternion q)
 o Matrix4
  public Matrix4(Point3 p)
 o Matrix4
  public Matrix4(Matrix4 m)

Methods

 o identity
  public synchronized void identity()
Load the identity transformation.
 o doQuatRotate
  public synchronized void doQuatRotate(Quaternion q)
 o translate
  public final void translate(float dx,
                              float dy,
                              float dz)
Translate the matrix by premultiplying with T(dx, dy, dz)
 o translate
  public final void translate(Matrix4 m,
                              float dx,
                              float dy,
                              float dz)
Set the matrix to T(dx, dy, dz) M
 o translate
  public final void translate(Point3 p)
Translate the matrix by premultiplying with T(P)
 o translate
  public final void translate(Matrix4 m,
                              Point3 p)
Set the matrix to T(P) M
 o scale
  public final void scale(float s)
Scale the matrix isotropically by premultiplying with S(s, s, s)
 o scale
  public final void scale(Matrix4 m,
                          float s)
Set the matrix to S(s, s, s) M
 o scale
  public final void scale(float sx,
                          float sy,
                          float sz)
Scale the matrix by premultiplying with S(sx, sy, sz)
 o scale
  public final void scale(Vector3 v)
Scale the matrix by premultiplying with S(v)
 o scale
  public final void scale(Matrix4 m,
                          float sx,
                          float sy,
                          float sz)
Set the matrix to S(sx, sy, sz) M
 o scale
  public final void scale(Matrix4 m,
                          Vector3 v)
Set the matrix to S(v) M
 o rotate
  public final void rotate(Quaternion q)
Apply the 3D rotation about the origin represented by the unit quaternion q.
 o rotate
  public final void rotate(Matrix4 m,
                           Quaternion q)
 o rotate
  public void rotate(float ax,
                     float ay,
                     float az,
                     float angle)
Apply a rotation of angle radians about the origin through the axis (ax, ay, az). The axis should be a unit vector.
 o rotate
  public void rotate(float ax,
                     float ay,
                     float az,
                     float sin,
                     float cos)
Apply a rotation about the origin through the axis (ax, ay, az) of an angle whose cosine and sine are as given. The axis should be a unit vector.
 o rotate
  public void rotate(Matrix4 m,
                     float ax,
                     float ay,
                     float az,
                     float angle)
Set the matrix to the rotation of matrix M through the axis (ax, ay, az) by angle radians. The axis should be a unit vector.
 o rotate
  public void rotate(Matrix4 m,
                     float ax,
                     float ay,
                     float az,
                     float cos,
                     float sin)
Set the matrix to the rotation of matrix M through the axis (ax, ay, az) by an angle whose cosine and sine are as given. The axis should be a unit vector.
 o rotate
  public void rotate(Vector3 axis,
                     float angle)
Apply a rotation of angle radians about the origin through axis. The axis should be a unit vector.
 o rotate
  public void rotate(Vector3 axis,
                     float sin,
                     float cos)
Apply a rotation through axis of angle radians about the origin of an angle whose cosine and sine are as given. The axis should be a unit vector.
 o rotate
  public void rotate(Matrix4 m,
                     Vector3 axis,
                     float angle)
Set the matrix to the rotation of matrix M by ANGLE radians about the origin through AXIS. The axis should be a unit vector.
 o rotate
  public void rotate(Matrix4 m,
                     Vector3 axis,
                     float sin,
                     float cos)
Set the matrix to the rotation of matrix M about the origin through AXIS by an angle whose cosine and sine are as given. The axis should be a unit vector.
 o xrotate
  public void xrotate(float angle)
X-axis rotation.
 o xrotate
  public void xrotate(Matrix4 m,
                      float angle)
 o yrotate
  public void yrotate(float angle)
Y-axis rotation.
 o yrotate
  public void yrotate(Matrix4 m,
                      float angle)
 o zrotate
  public void zrotate(float angle)
Z-axis rotation.
 o zrotate
  public void zrotate(Matrix4 m,
                      float angle)
 o rotate
  public final void rotate(float angle)
2-dimensional rotation (in the xy-plane)
 o rotate
  public final void rotate(Matrix4 m,
                           float angle)
 o preMultiply
  public synchronized void preMultiply(Matrix4 m)
Pre-multiply with another matrix.
 o postMultiply
  public synchronized void postMultiply(Matrix4 m)
Post-multiply with another matrix.
 o multiply
  public synchronized void multiply(Matrix4 m1,
                                    Matrix4 m2)
Set the matrix to the product of matrices m1 and m2
 o transpose
  public void transpose()
Compute the transpose of the matrix.
 o transpose
  public void transpose(Matrix4 m)
Set the matrix to the transpose of m.
 o invert
  public synchronized void invert() throws MatrixInversionException
Invert the matrix. @exception MatrixInversionException if the matrix is singular.
 o inverse
  public synchronized void inverse(Matrix4 m) throws MatrixInversionException
Set the matrix to the inverse of m @param m m is a non-singular matrix. @exception MatrixInversionException if m is singular.
 o determinant
  public synchronized float determinant()
Return the determinant of the matrix.
 o getOverallScalingFactor
  public float getOverallScalingFactor()
Return the overall scaling factor of this matrix. This is the amount by which distances are scaled as a result of this transformation. Note that this value is of limited usefulness if the matrix is not angle-preserving (e.g. it contains anisotropic scaling components).
 o decompose
  public final void decompose(Point3 translation)
Decompose the matrix into a translation. This is the same as what is returned in the fourth argument to getRows().
 o decompose
  public final boolean decompose(Quaternion rotation)
Decompose the matrix into a rotation. Return whether or not the decomposition was successful.
 o decompose
  public final boolean decompose(Quaternion rotation,
                                 Point3 translation)
Decompose the matrix into a rotation and translation. Return whether or not the decomposition was successful.
 o decompose
  public final boolean decompose(Quaternion rotation,
                                 Point3 translation,
                                 Vector3 scale)
Decompose the matrix into a rotation, translation, and scaling. Return whether or not the decomposition was successful.
 o destructiveDecompose
  public final boolean destructiveDecompose(Quaternion rotation,
                                            Point3 translation,
                                            Vector3 scale)
 o isIdentity
  public final boolean isIdentity()
Return true if the matrix is the identity matrix.
 o isLinear
  public final boolean isLinear()
Return true if the matrix represents a 3D linear transformation.
 o isAffine
  public final boolean isAffine()
Return true if the matrix represents a 3D affine transformation.
 o isLengthPreserving
  public final boolean isLengthPreserving()
Return true if the matrix represents a length-preserving (rigid) transformation in 3D space.
 o optimize
  public void optimize()
This method attempts to classify the matrix as a member one of of several special categories so that further computations involving it are more efficient. Optimizing a matrix requires a significant amount of computation and should only be done if the matrix will be used often. If the matrix is to be used in rendering, it's generally a good idea to optimize it first. Also, matrix inversion can be sped up a great deal if the matrix can be classified. Finally, a matrix only needs to be optimized if it wasn't constructed with the identity constructor or if the setValue method has been used; all the other methods keep track of any special matrix properties.
 o setElements
  public void setElements(float m[])
 o getElements
  public void getElements(float m[])
 o getRows
  public void getRows(Vector3 row0,
                      Vector3 row1,
                      Vector3 row2)
 o getRows
  public void getRows(Vector3 row0,
                      Vector3 row1,
                      Vector3 row2,
                      Point3 row3)
 o equals
  public boolean equals(Matrix4 m)
 o equals
  public boolean equals(Object o)
Overrides:
equals in class Object
 o copy
  public void copy(Copyable c)
 o clone
  public Object clone()
Overrides:
clone in class Object
 o clear
  public void clear()
 o toString
  public String toString()
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index