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.
-
Matrix4()
- Identity matrix constructor.
-
Matrix4(float[])
-
-
Matrix4(Matrix4)
-
-
Matrix4(Point3)
-
-
Matrix4(Quaternion)
-
-
clear()
-
-
clone()
-
-
copy(Copyable)
-
-
decompose(Point3)
- Decompose the matrix into a translation.
-
decompose(Quaternion)
- Decompose the matrix into a rotation.
-
decompose(Quaternion, Point3)
- Decompose the matrix into a rotation and translation.
-
decompose(Quaternion, Point3, Vector3)
- Decompose the matrix into a rotation, translation, and scaling.
-
destructiveDecompose(Quaternion, Point3, Vector3)
-
-
determinant()
- Return the determinant of the matrix.
-
doQuatRotate(Quaternion)
-
-
equals(Matrix4)
-
-
equals(Object)
-
-
getElements(float[])
-
-
getOverallScalingFactor()
- Return the overall scaling factor of this matrix.
-
getRows(Vector3, Vector3, Vector3)
-
-
getRows(Vector3, Vector3, Vector3, Point3)
-
-
identity()
- Load the identity transformation.
-
inverse(Matrix4)
- Set the matrix to the inverse of m
-
invert()
- Invert the matrix.
-
isAffine()
- Return true if the matrix represents a 3D affine transformation.
-
isIdentity()
- Return true if the matrix is the identity matrix.
-
isLengthPreserving()
- Return true if the matrix represents a length-preserving (rigid)
transformation in 3D space.
-
isLinear()
- Return true if the matrix represents a 3D linear transformation.
-
multiply(Matrix4, Matrix4)
- Set the matrix to the product of matrices m1 and m2
-
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.
-
postMultiply(Matrix4)
- Post-multiply with another matrix.
-
preMultiply(Matrix4)
- Pre-multiply with another matrix.
-
rotate(float)
- 2-dimensional rotation (in the xy-plane)
-
rotate(float, float, float, float)
- Apply a rotation of angle radians about the origin through the
axis (ax, ay, az).
-
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.
-
rotate(Matrix4, float)
-
-
rotate(Matrix4, float, float, float, float)
- Set the matrix to the rotation of matrix M through the axis
(ax, ay, az) by angle radians.
-
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.
-
rotate(Matrix4, Quaternion)
-
-
rotate(Matrix4, Vector3, float)
- Set the matrix to the rotation of matrix M by ANGLE radians about
the origin through AXIS.
-
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.
-
rotate(Quaternion)
- Apply the 3D rotation about the origin represented by the unit
quaternion q.
-
rotate(Vector3, float)
- Apply a rotation of angle radians about the origin through axis.
-
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.
-
scale(float)
- Scale the matrix isotropically by premultiplying with S(s, s, s)
-
scale(float, float, float)
- Scale the matrix by premultiplying with S(sx, sy, sz)
-
scale(Matrix4, float)
- Set the matrix to S(s, s, s) M
-
scale(Matrix4, float, float, float)
- Set the matrix to S(sx, sy, sz) M
-
scale(Matrix4, Vector3)
- Set the matrix to S(v) M
-
scale(Vector3)
- Scale the matrix by premultiplying with S(v)
-
setElements(float[])
-
-
toString()
-
-
translate(float, float, float)
- Translate the matrix by premultiplying with T(dx, dy, dz)
-
translate(Matrix4, float, float, float)
- Set the matrix to T(dx, dy, dz) M
-
translate(Matrix4, Point3)
- Set the matrix to T(P) M
-
translate(Point3)
- Translate the matrix by premultiplying with T(P)
-
transpose()
- Compute the transpose of the matrix.
-
transpose(Matrix4)
- Set the matrix to the transpose of m.
-
xrotate(float)
- X-axis rotation.
-
xrotate(Matrix4, float)
-
-
yrotate(float)
- Y-axis rotation.
-
yrotate(Matrix4, float)
-
-
zrotate(float)
- Z-axis rotation.
-
zrotate(Matrix4, float)
-
Matrix4
public Matrix4()
- Identity matrix constructor.
Matrix4
public Matrix4(float m[])
Matrix4
public Matrix4(Quaternion q)
Matrix4
public Matrix4(Point3 p)
Matrix4
public Matrix4(Matrix4 m)
identity
public synchronized void identity()
- Load the identity transformation.
doQuatRotate
public synchronized void doQuatRotate(Quaternion q)
translate
public final void translate(float dx,
float dy,
float dz)
- Translate the matrix by premultiplying with T(dx, dy, dz)
translate
public final void translate(Matrix4 m,
float dx,
float dy,
float dz)
- Set the matrix to T(dx, dy, dz) M
translate
public final void translate(Point3 p)
- Translate the matrix by premultiplying with T(P)
translate
public final void translate(Matrix4 m,
Point3 p)
- Set the matrix to T(P) M
scale
public final void scale(float s)
- Scale the matrix isotropically by premultiplying with S(s, s, s)
scale
public final void scale(Matrix4 m,
float s)
- Set the matrix to S(s, s, s) M
scale
public final void scale(float sx,
float sy,
float sz)
- Scale the matrix by premultiplying with S(sx, sy, sz)
scale
public final void scale(Vector3 v)
- Scale the matrix by premultiplying with S(v)
scale
public final void scale(Matrix4 m,
float sx,
float sy,
float sz)
- Set the matrix to S(sx, sy, sz) M
scale
public final void scale(Matrix4 m,
Vector3 v)
- Set the matrix to S(v) M
rotate
public final void rotate(Quaternion q)
- Apply the 3D rotation about the origin represented by the unit
quaternion q.
rotate
public final void rotate(Matrix4 m,
Quaternion q)
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.
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.
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.
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.
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.
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.
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.
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.
xrotate
public void xrotate(float angle)
- X-axis rotation.
xrotate
public void xrotate(Matrix4 m,
float angle)
yrotate
public void yrotate(float angle)
- Y-axis rotation.
yrotate
public void yrotate(Matrix4 m,
float angle)
zrotate
public void zrotate(float angle)
- Z-axis rotation.
zrotate
public void zrotate(Matrix4 m,
float angle)
rotate
public final void rotate(float angle)
- 2-dimensional rotation (in the xy-plane)
rotate
public final void rotate(Matrix4 m,
float angle)
preMultiply
public synchronized void preMultiply(Matrix4 m)
- Pre-multiply with another matrix.
postMultiply
public synchronized void postMultiply(Matrix4 m)
- Post-multiply with another matrix.
multiply
public synchronized void multiply(Matrix4 m1,
Matrix4 m2)
- Set the matrix to the product of matrices m1 and m2
transpose
public void transpose()
- Compute the transpose of the matrix.
transpose
public void transpose(Matrix4 m)
- Set the matrix to the transpose of m.
invert
public synchronized void invert() throws MatrixInversionException
- Invert the matrix.
@exception MatrixInversionException if the matrix is singular.
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.
determinant
public synchronized float determinant()
- Return the determinant of the matrix.
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).
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().
decompose
public final boolean decompose(Quaternion rotation)
- Decompose the matrix into a rotation. Return whether or not
the decomposition was successful.
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.
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.
destructiveDecompose
public final boolean destructiveDecompose(Quaternion rotation,
Point3 translation,
Vector3 scale)
isIdentity
public final boolean isIdentity()
- Return true if the matrix is the identity matrix.
isLinear
public final boolean isLinear()
- Return true if the matrix represents a 3D linear transformation.
isAffine
public final boolean isAffine()
- Return true if the matrix represents a 3D affine transformation.
isLengthPreserving
public final boolean isLengthPreserving()
- Return true if the matrix represents a length-preserving (rigid)
transformation in 3D space.
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.
setElements
public void setElements(float m[])
getElements
public void getElements(float m[])
getRows
public void getRows(Vector3 row0,
Vector3 row1,
Vector3 row2)
getRows
public void getRows(Vector3 row0,
Vector3 row1,
Vector3 row2,
Point3 row3)
equals
public boolean equals(Matrix4 m)
equals
public boolean equals(Object o)
- Overrides:
- equals in class Object
copy
public void copy(Copyable c)
clone
public Object clone()
- Overrides:
- clone in class Object
clear
public void clear()
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index