public class Matrix4f
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
float |
m00
The first element of the first row.
|
float |
m01
The second element of the first row.
|
float |
m02
third element of the first row.
|
float |
m03
The fourth element of the first row.
|
float |
m10
The first element of the second row.
|
float |
m11
The second element of the second row.
|
float |
m12
The third element of the second row.
|
float |
m13
The fourth element of the second row.
|
float |
m20
The first element of the third row.
|
float |
m21
The second element of the third row.
|
float |
m22
The third element of the third row.
|
float |
m23
The fourth element of the third row.
|
float |
m30
The first element of the fourth row.
|
float |
m31
The second element of the fourth row.
|
float |
m32
The third element of the fourth row.
|
float |
m33
The fourth element of the fourth row.
|
Constructor and Description |
---|
Matrix4f() |
Modifier and Type | Method and Description |
---|---|
float |
determinant()
Computes the determinant of this matrix.
|
boolean |
equals(java.lang.Object o)
Returns true if the Object o is of type Matrix4f and all of the data
members of t1 are equal to the corresponding data members in this Matrix4f.
|
void |
get(V3 trans)
Retrieves the translational components of this matrix.
|
void |
getColumn(int column,
float[] v)
Copies the matrix values in the specified column into the array parameter.
|
float |
getElement(int row,
int column)
Retrieves the value at the specified row and column of this matrix.
|
void |
getRotationScale(Matrix3f m1)
Gets the upper 3x3 values of this matrix and places them into the matrix
m1.
|
void |
getRow(int row,
float[] v)
Copies the matrix values in the specified row into the array parameter.
|
int |
hashCode()
Returns a hash number based on the data values in this object.
|
void |
invert()
Sets the value of this matrix to its inverse.
|
void |
invertM(Matrix4f m1)
Sets the value of this matrix to the matrix inverse of the passed matrix
m1.
|
private void |
mul(float scalar)
Multiplies each element of this matrix by a scalar.
|
void |
mul2(Matrix4f m1,
Matrix4f m2)
Sets the value of this matrix to the result of multiplying the two argument
matrices together.
|
void |
mulM4(Matrix4f m1)
Sets the value of this matrix to the result of multiplying itself with
matrix m1.
|
static Matrix4f |
newA(float[] v)
Constructs and initializes a Matrix4f from the specified 16 element array.
|
static Matrix4f |
newM(Matrix4f m1)
Constructs a new matrix with the same values as the Matrix4f parameter.
|
static Matrix4f |
newMV(Matrix3f m1,
V3 t)
Constructs and initializes a Matrix4f from the rotation matrix
and translation.
|
void |
rotX(float angle)
Sets the value of this matrix to a rotation matrix about the x axis by the
passed angle.
|
void |
rotY(float angle)
Sets the value of this matrix to a rotation matrix about the y axis by the
passed angle.
|
void |
rotZ(float angle)
Sets the value of this matrix to a rotation matrix about the z axis by the
passed angle.
|
private void |
set(float m00,
float m01,
float m02,
float m03,
float m10,
float m11,
float m12,
float m13,
float m20,
float m21,
float m22,
float m23,
float m30,
float m31,
float m32,
float m33)
Sets 16 values
|
void |
setA(float[] m)
Sets the values in this Matrix4f equal to the row-major array parameter
(ie, the first four elements of the array will be copied into the first row
of this matrix, etc.).
|
void |
setAA(AxisAngle4f a1)
Sets the value of this matrix to the matrix conversion of the single
precision axis and angle argument.
|
void |
setColumn(int column,
float[] v)
Sets the specified column of this matrix4f to the four values provided.
|
void |
setColumn4(int column,
float x,
float y,
float z,
float w)
Sets the specified column of this matrix4f to the four values provided.
|
void |
setElement(int row,
int column,
float value)
Sets the specified element of this matrix4f to the value provided.
|
private void |
setFromAxisAngle(double x,
double y,
double z,
double angle) |
void |
setIdentity()
Sets this Matrix4f to identity.
|
void |
setM(Matrix4f m1)
Sets the value of this matrix to a copy of the passed matrix m1.
|
void |
setM3(Matrix3f m1)
Sets the rotational component (upper 3x3) of this matrix to the matrix
values in the single precision Matrix3f argument; the other elements of
this matrix are initialized as if this were an identity matrix (ie, affine
matrix with no translational component).
|
void |
setMV(Matrix3f m1,
V3 t)
Initializes a Matrix4f from the rotation matrix
and translation.
|
void |
setRotationScale(Matrix3f m1)
Replaces the upper 3x3 matrix values of this matrix with the values in the
matrix m1.
|
void |
setRow(int row,
float[] v)
Sets the specified row of this matrix4f to the four values provided.
|
void |
setTranslation(V3 trans)
Modifies the translational components of this matrix to the values of the
Vector3f argument; the other values of this matrix are not modified.
|
void |
setZero()
Sets this matrix to all zeros.
|
void |
sub(Matrix4f m1)
Sets the value of this matrix to the matrix difference of itself and matrix
m1 (this = this - m1).
|
java.lang.String |
toString()
Returns a string that contains the values of this Matrix4f.
|
void |
transform(P3 point)
Transforms the point parameter with this Matrix4f and places the result
back into point.
|
void |
transform2(P3 point,
P3 pointOut)
Transforms the point parameter with this Matrix4f and places the result
into pointOut.
|
void |
transform4(Tuple4f vec)
Transform the vector vec using this Matrix4f and place the result back into
vec.
|
void |
transformT2(Tuple4f vec,
Tuple4f vecOut)
Transform the vector vec using this Matrix4f and place the result into
vecOut.
|
void |
transformV(V3 normal)
Transforms the normal parameter by this transform and places the value back
into normal.
|
void |
transformV2(V3 normal,
V3 normalOut)
Transforms the normal parameter by this Matrix4f and places the value into
normalOut.
|
void |
transpose()
Sets the value of this matrix to its transpose.
|
public float m00
public float m01
public float m02
public float m03
public float m10
public float m11
public float m12
public float m13
public float m20
public float m21
public float m22
public float m23
public float m30
public float m31
public float m32
public float m33
public static Matrix4f newA(float[] v)
v
- the array of length 16 containing in orderpublic static Matrix4f newM(Matrix4f m1)
m1
- the source matrixpublic static Matrix4f newMV(Matrix3f m1, V3 t)
m1
- The rotation matrix representing the rotational componentst
- The translational components of the matrixpublic void setMV(Matrix3f m1, V3 t)
m1
- The rotation matrix representing the rotational componentst
- The translational components of the matrixpublic final void setAA(AxisAngle4f a1)
a1
- the axis and angle to be convertedprivate void setFromAxisAngle(double x, double y, double z, double angle)
public final void setM(Matrix4f m1)
m1
- the matrix to be copiedpublic java.lang.String toString()
toString
in class java.lang.Object
public final void setIdentity()
public final void setElement(int row, int column, float value)
row
- the row number to be modified (zero indexed)column
- the column number to be modified (zero indexed)value
- the new valuepublic final float getElement(int row, int column)
row
- the row number to be retrieved (zero indexed)column
- the column number to be retrieved (zero indexed)public final void get(V3 trans)
trans
- the vector that will receive the translational componentpublic final void getRotationScale(Matrix3f m1)
m1
- The matrix that will hold the valuespublic final void setRotationScale(Matrix3f m1)
m1
- The matrix that will be the new upper 3x3public final void setRow(int row, float[] v)
row
- the row number to be modified (zero indexed)v
- the replacement rowpublic final void getRow(int row, float[] v)
row
- the matrix rowv
- The array into which the matrix row values will be copiedpublic final void setColumn4(int column, float x, float y, float z, float w)
column
- the column number to be modified (zero indexed)x
- the first row elementy
- the second row elementz
- the third row elementw
- the fourth row elementpublic final void setColumn(int column, float[] v)
column
- the column number to be modified (zero indexed)v
- the replacement columnpublic final void getColumn(int column, float[] v)
column
- the matrix columnv
- The array into which the matrix column values will be copiedpublic final void sub(Matrix4f m1)
m1
- the other matrixpublic final void transpose()
public final void invertM(Matrix4f m1)
m1
- the matrix to be invertedpublic final void invert()
public final float determinant()
public final void setM3(Matrix3f m1)
m1
- the 3x3 matrixpublic final void setA(float[] m)
m
- public void setTranslation(V3 trans)
trans
- the translational componentpublic final void rotX(float angle)
angle
- the angle to rotate about the X axis in radianspublic final void rotY(float angle)
angle
- the angle to rotate about the Y axis in radianspublic final void rotZ(float angle)
angle
- the angle to rotate about the Z axis in radiansprivate final void mul(float scalar)
scalar
- The scalar multiplier.public final void mulM4(Matrix4f m1)
m1
- the other matrixpublic final void mul2(Matrix4f m1, Matrix4f m2)
m1
- the first matrixm2
- the second matrixpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object with which the comparison is made.public int hashCode()
hashCode
in class java.lang.Object
public final void transformT2(Tuple4f vec, Tuple4f vecOut)
vec
- the single precision vector to be transformedvecOut
- the vector into which the transformed values are placedpublic final void transform4(Tuple4f vec)
vec
- the single precision vector to be transformedpublic final void transform2(P3 point, P3 pointOut)
point
- the input point to be transformed.pointOut
- the transformed pointpublic final void transform(P3 point)
point
- the input point to be transformed.public final void transformV2(V3 normal, V3 normalOut)
normal
- the input normal to be transformed.normalOut
- the transformed normalpublic final void transformV(V3 normal)
normal
- the input normal to be transformed.public final void setZero()
private void set(float m00, float m01, float m02, float m03, float m10, float m11, float m12, float m13, float m20, float m21, float m22, float m23, float m30, float m31, float m32, float m33)
m00
- m01
- m02
- m03
- m10
- m11
- m12
- m13
- m20
- m21
- m22
- m23
- m30
- m31
- m32
- m33
-