| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectjavax.vecmath.Matrix4fpublic class Matrix4fextends java.lang.Objectimplements SerializableField Summary | |
float |
|
float |
|
float |
|
float |
|
float |
|
float |
|
float |
|
float |
|
float |
|
float |
|
float |
|
float |
|
float |
|
float |
|
float |
|
float |
|
Constructor Summary | |
| |
| |
| |
Method Summary | |
void |
|
void | |
void | |
void | |
float |
|
boolean |
|
boolean |
|
boolean | |
void | |
void | |
float | |
void | |
void | |
void | |
void |
|
float |
|
void |
|
void | |
void |
|
float |
|
int |
|
void |
|
void | |
void |
|
void | |
void | |
void | |
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void | |
void | |
void | |
void | |
void | |
void | |
void | |
void | |
void | |
void | |
void | |
void | |
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
void | |
void | |
String |
|
void | |
void | |
void | |
void | |
void | |
void | |
void |
|
void | |
public float m00
The first element of the first row.
public float m01
The second element of the first row.
public float m02
third element of the first row.
public float m03
The fourth element of the first row.
public float m10
The first element of the second row.
public float m11
The second element of the second row.
public float m12
The third element of the second row.
public float m13
The fourth element of the second row.
public float m20
The first element of the third row.
public float m21
The second element of the third row.
public float m22
The third element of the third row.
public float m23
The fourth element of the third row.
public float m30
The first element of the fourth row.
public float m31
The second element of the fourth row.
public float m32
The third element of the fourth row.
public float m33
The fourth element of the fourth row.
public Matrix4f()
Constructs and initializes a Matrix4f to all zeros.
public Matrix4f(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)Constructs and initializes a Matrix4f from the specified 16 values.
- Parameters:
m00- the [0][0] elementm01- the [0][1] elementm02- the [0][2] elementm03- the [0][3] elementm10- the [1][0] elementm11- the [1][1] elementm12- the [1][2] elementm13- the [1][3] elementm20- the [2][0] elementm21- the [2][1] elementm22- the [2][2] elementm23- the [2][3] elementm30- the [3][0] elementm31- the [3][1] elementm32- the [3][2] elementm33- the [3][3] element
public Matrix4f(Matrix3f m1, Vector3f t1, float s)
Constructs and initializes a Matrix4f from the rotation matrix, translation, and scale values; the scale is applied only to the rotational components of the matrix (upper 3x3) and not to the translational components.
- Parameters:
m1- The rotation matrix representing the rotational componentst1- The translational components of the matrixs- The scale value applied to the rotational components
public Matrix4f(Matrix4d m1)
Constructs a new matrix with the same values as the Matrix4d parameter.
- Parameters:
m1- The source matrix.
public Matrix4f(Matrix4f m1)
Constructs a new matrix with the same values as the Matrix4f parameter.
- Parameters:
m1- The source matrix.
public Matrix4f(Quat4f q1, Vector3f t1, float s)
Constructs and initializes a Matrix4f from the quaternion, translation, and scale values; the scale is applied only to the rotational components of the matrix (upper 3x3) and not to the translational components.
- Parameters:
q1- The quaternion value representing the rotational componentt1- The translational component of the matrixs- The scale value applied to the rotational components
public Matrix4f(v[] )
Constructs and initializes a Matrix4f from the specified 16 element array. this.m00 =v[0], this.m01=v[1], etc.
- Parameters:
public final void add(float scalar)
Adds a scalar to each component of this matrix.
- Parameters:
scalar- The scalar adder.
public final void add(float scalar,
Matrix4f m1)Adds a scalar to each component of the matrix m1 and places the result into this. Matrix m1 is not modified.
- Parameters:
scalar- The scalar adder.
public final void add(Matrix4f m1)
Sets the value of this matrix to sum of itself and matrix m1.
- Parameters:
m1- the other matrix
public final void add(Matrix4f m1, Matrix4f m2)
Sets the value of this matrix to the matrix sum of matrices m1 and m2.
- Parameters:
m1- the first matrixm2- the second matrix
public final float determinant()
Computes the determinant of this matrix.
- Returns:
- the determinant of the matrix
public boolean epsilonEquals(Matrix4f m1, float epsilon)
Returns true if the L-infinite distance between this matrix and matrix m1 is less than or equal to the epsilon parameter, otherwise returns false. The L-infinite distance is equal to MAX[i=0,1,2,3 ; j=0,1,2,3 ; abs(this.m(i,j) - m1.m(i,j)]
- Parameters:
m1- The matrix to be compared to this matrixepsilon- the threshold value
public boolean equals(Object o1)
Returns true if the Object o1 is of type Matrix4f and all of the data members of t1 are equal to the corresponding data members in this Matrix4f.
- Parameters:
o1- the object with which the comparison is made.
public boolean equals(Matrix4f m1)
Returns true if all of the data members of Matrix4f m1 are equal to the corresponding data members in this Matrix4f.
- Parameters:
m1- The matrix with which the comparison is made.
- Returns:
- true or false
public final void get(Matrix3d m1)
Performs an SVD normalization of this matrix in order to acquire the normalized rotational component; the values are placed into the Matrix3d parameter.
- Parameters:
m1- matrix into which the rotational component is placed
public final void get(Matrix3f m1)
Performs an SVD normalization of this matrix in order to acquire the normalized rotational component; the values are placed into the Matrix3f parameter.
- Parameters:
m1- matrix into which the rotational component is placed
public final float get(Matrix3f m1, Vector3f t1)
Performs an SVD normalization of this matrix to calculate the rotation as a 3x3 matrix, the translation, and the scale. None of the matrix values are modified.
- Parameters:
m1- The normalized matrix representing the rotationt1- The translation component
- Returns:
- The scale component of this transform
public final void get(Quat4f q1)
Performs an SVD normalization of this matrix in order to acquire the normalized rotational component; the values are placed into the Quat4f parameter.
- Parameters:
q1- quaternion into which the rotation component is placed
public final void get(Vector3f trans)
Retrieves the translational components of this matrix.
- Parameters:
trans- the vector that will receive the translational component
public final void getColumn(int column,
Vector4f v)Copies the matrix values in the specified column into the vector parameter.
- Parameters:
column- the matrix columnv- The vector into which the matrix column values will be copied
public final void getColumn(int column,
v[] )Copies the matrix values in the specified column into the array parameter.
- Parameters:
column- the matrix column
public final float getElement(int row,
int column)Retrieves the value at the specified row and column of this matrix.
- Parameters:
row- the row number to be retrieved (zero indexed)column- the column number to be retrieved (zero indexed)
- Returns:
- the value at the indexed element
public final void getRotationScale(Matrix3f m1)
Gets the upper 3x3 values of this matrix and places them into the matrix m1.
- Parameters:
m1- The matrix that will hold the values
public final void getRow(int row,
Vector4f v)Copies the matrix values in the specified row into the vector parameter.
- Parameters:
row- the matrix rowv- The vector into which the matrix row values will be copied
public final void getRow(int row,
v[] )Copies the matrix values in the specified row into the array parameter.
- Parameters:
row- the matrix row
public final float getScale()
Performs an SVD normalization of this matrix to calculate and return the uniform scale factor. This matrix is not modified.
- Returns:
- the scale factor of this matrix
public int hashCode()
Returns a hash number based on the data values in this object. Two different Matrix4f objects with identical data values (ie, returns true for equals(Matrix4f) ) will return the same hash number. Two objects with different data members may return the same hash value, although this is not likely.
- Returns:
- the integer hash value
public final void invert()
Sets the value of this matrix to its inverse.
public final void invert(Matrix4f m1)
Sets the value of this matrix to the matrix inverse of the passed matrix m1.
- Parameters:
m1- the matrix to be inverted
public final void mul(float scalar)
Multiplies each element of this matrix by a scalar.
- Parameters:
scalar- The scalar multiplier.
public final void mul(float scalar,
Matrix4f m1)Multiplies each element of matrix m1 by a scalar and places the result into this. Matrix m1 is not modified.
- Parameters:
scalar- The scalar multiplier.m1- The original matrix.
public final void mul(Matrix4f m1)
Sets the value of this matrix to the result of multiplying itself with matrix m1.
- Parameters:
m1- the other matrix
public final void mul(Matrix4f m1, Matrix4f m2)
Sets the value of this matrix to the result of multiplying the two argument matrices together.
- Parameters:
m1- the first matrixm2- the second matrix
public final void mulTransposeBoth(Matrix4f m1, Matrix4f m2)
Multiplies the transpose of matrix m1 times the transpose of matrix m2, and places the result into this.
- Parameters:
m1- The matrix on the left hand side of the multiplicationm2- The matrix on the right hand side of the multiplication
public final void mulTransposeLeft(Matrix4f m1, Matrix4f m2)
Multiplies the transpose of matrix m1 times matrix m2, and places the result into this.
- Parameters:
m1- The matrix on the left hand side of the multiplicationm2- The matrix on the right hand side of the multiplication
public final void mulTransposeRight(Matrix4f m1, Matrix4f m2)
Multiplies matrix m1 times the transpose of matrix m2, and places the result into this.
- Parameters:
m1- The matrix on the left hand side of the multiplicationm2- The matrix on the right hand side of the multiplication
public final void negate()
Negates the value of this matrix: this = -this.
public final void negate(Matrix4f m1)
Sets the value of this matrix equal to the negation of of the Matrix4f parameter.
- Parameters:
m1- The source matrix
public final void rotX(float angle)
Sets the value of this matrix to a rotation matrix about the x axis by the passed angle.
- Parameters:
angle- the angle to rotate about the X axis in radians
public final void rotY(float angle)
Sets the value of this matrix to a rotation matrix about the y axis by the passed angle.
- Parameters:
angle- the angle to rotate about the Y axis in radians
public final void rotZ(float angle)
Sets the value of this matrix to a rotation matrix about the z axis by the passed angle.
- Parameters:
angle- the angle to rotate about the Z axis in radians
public final void set(float scale)
Sets the value of this matrix to a scale matrix with the passed scale amount.
- Parameters:
scale- the scale factor for the matrix
public final void set(float scale,
Vector3f v1)Sets the value of this matrix to a scale and translation matrix; scale is not applied to the translation and all of the matrix values are modified.
- Parameters:
scale- the scale factor for the matrixv1- the translation amount
public final void set(AxisAngle4d a1)
Sets the value of this matrix to the matrix conversion of the single precision axis and angle argument.
- Parameters:
a1- the axis and angle to be converted
public final void set(AxisAngle4f a1)
Sets the value of this matrix to the matrix conversion of the single precision axis and angle argument.
- Parameters:
a1- the axis and angle to be converted
public final void set(Matrix3d m1)
Sets the rotational component (upper 3x3) of this matrix to the matrix values in the double precision Matrix3d argument; the other elements of this matrix are initialized as if this were an identity matrix (ie, affine matrix with no translational component).
- Parameters:
m1- the 3x3 matrix
public final void set(Matrix3d m1, Vector3d t1, double scale)
Sets the value of this matrix from the rotation expressed by the rotation matrix m1, the translation t1, and the scale s. The translation is not modified by the scale.
- Parameters:
m1- The rotation componentt1- The translation componentscale- The scale component
public final void set(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).
- Parameters:
m1- the 3x3 matrix
public final void set(Matrix3f m1, Vector3f t1, float scale)
Sets the value of this matrix from the rotation expressed by the rotation matrix m1, the translation t1, and the scale s. The translation is not modified by the scale.
- Parameters:
m1- The rotation componentt1- The translation componentscale- The scale component
public final void set(Matrix4d m1)
Sets the value of this matrix to a copy of the passed matrix m1.
- Parameters:
m1- the matrix to be copied
public final void set(Matrix4f m1)
Sets the value of this matrix to a copy of the passed matrix m1.
- Parameters:
m1- the matrix to be copied
public final void set(Quat4d q1)
Sets the value of this matrix to the matrix conversion of the (double precision) quaternion argument.
- Parameters:
q1- the quaternion to be converted
public final void set(Quat4d q1, Vector3d t1, double s)
Sets the value of this matrix from the rotation expressed by the quaternion q1, the translation t1, and the scale s.
- Parameters:
q1- the rotation expressed as a quaterniont1- the translations- the scale value
public final void set(Quat4f q1)
Sets the value of this matrix to the matrix conversion of the single precision quaternion argument.
- Parameters:
q1- the quaternion to be converted
public final void set(Quat4f q1, Vector3f t1, float s)
Sets the value of this matrix from the rotation expressed by the quaternion q1, the translation t1, and the scale s.
- Parameters:
q1- the rotation expressed as a quaterniont1- the translations- the scale value
public final void set(Vector3f v1)
Sets the value of this matrix to a translate matrix by the passed translation value.
- Parameters:
v1- the translation amount
public final void set(Vector3f v1, float scale)
Sets the value of this matrix to a scale and translation matrix; the translation is scaled by the scale factor and all of the matrix values are modified.
- Parameters:
v1- the translation amountscale- the scale factor for the matrix
public final void set(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.).
public final void setColumn(int column,
float x,
float y,
float z,
float w)Sets the specified column of this matrix4f to the four values provided.
- Parameters:
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 element
public final void setColumn(int column,
Vector4f v)Sets the specified column of this matrix4f to the vector provided.
- Parameters:
column- the column number to be modified (zero indexed)v- the replacement column
public final void setColumn(int column,
v[] )Sets the specified column of this matrix4f to the four values provided.
- Parameters:
column- the column number to be modified (zero indexed)
public final void setElement(int row,
int column,
float value)Sets the specified element of this matrix4f to the value provided.
- Parameters:
row- the row number to be modified (zero indexed)column- the column number to be modified (zero indexed)value- the new value
public final void setIdentity()
Sets this Matrix4f to identity.
public final void setRotation(AxisAngle4f a1)
Sets the rotational component (upper 3x3) of this matrix to the matrix equivalent values of the axis-angle argument; the other elements of this matrix are unchanged; a singular value decomposition is performed on this object's upper 3x3 matrix to factor out the scale, then this object's upper 3x3 matrix components are replaced by the matrix equivalent of the axis-angle, and then the scale is reapplied to the rotational components.
- Parameters:
a1- the axis-angle to be converted (x, y, z, angle)
public final void setRotation(Matrix3d 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 unchanged; a singular value decomposition is performed on this object's upper 3x3 matrix to factor out the scale, then this object's upper 3x3 matrix components are replaced by the passed rotation components, and then the scale is reapplied to the rotational components.
- Parameters:
m1- single precision 3x3 matrix
public final void setRotation(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 unchanged; a singular value decomposition is performed on this object's upper 3x3 matrix to factor out the scale, then this object's upper 3x3 matrix components are replaced by the passed rotation components, and then the scale is reapplied to the rotational components.
- Parameters:
m1- single precision 3x3 matrix
public final void setRotation(Quat4d q1)
Sets the rotational component (upper 3x3) of this matrix to the matrix equivalent values of the quaternion argument; the other elements of this matrix are unchanged; a singular value decomposition is performed on this object's upper 3x3 matrix to factor out the scale, then this object's upper 3x3 matrix components are replaced by the matrix equivalent of the quaternion, and then the scale is reapplied to the rotational components.
- Parameters:
q1- the quaternion that specifies the rotation
public final void setRotation(Quat4f q1)
Sets the rotational component (upper 3x3) of this matrix to the matrix equivalent values of the quaternion argument; the other elements of this matrix are unchanged; a singular value decomposition is performed on this object's upper 3x3 matrix to factor out the scale, then this object's upper 3x3 matrix components are replaced by the matrix equivalent of the quaternion, and then the scale is reapplied to the rotational components.
- Parameters:
q1- the quaternion that specifies the rotation
public final void setRotationScale(Matrix3f m1)
Replaces the upper 3x3 matrix values of this matrix with the values in the matrix m1.
- Parameters:
m1- The matrix that will be the new upper 3x3
public final void setRow(int row,
float x,
float y,
float z,
float w)Sets the specified row of this matrix4f to the four values provided.
- Parameters:
row- the row number to be modified (zero indexed)x- the first column elementy- the second column elementz- the third column elementw- the fourth column element
public final void setRow(int row,
Vector4f v)Sets the specified row of this matrix4f to the Vector provided.
- Parameters:
row- the row number to be modified (zero indexed)v- the replacement row
public final void setRow(int row,
v[] )Sets the specified row of this matrix4f to the four values provided.
- Parameters:
row- the row number to be modified (zero indexed)
public final void setScale(float scale)
Sets the scale component of the current matrix by factoring out the current scale (by doing an SVD) from the rotational component and multiplying by the new scale.
- Parameters:
scale- the new scale amount
public void setTranslation(Vector3f trans)
Modifies the translational components of this matrix to the values of the Vector3f argument; the other values of this matrix are not modified.
- Parameters:
trans- the translational component
public final void setZero()
Sets this matrix to all zeros.
public final void sub(Matrix4f m1)
Sets the value of this matrix to the matrix difference of itself and matrix m1 (this = this - m1).
- Parameters:
m1- the other matrix
public final void sub(Matrix4f m1, Matrix4f m2)
Sets the value of this matrix to the matrix difference of matrices m1 and m2.
- Parameters:
m1- the first matrixm2- the second matrix
public String toString()
Returns a string that contains the values of this Matrix4f.
- Returns:
- the String representation
public final void transform(Point3f point)
Transforms the point parameter with this Matrix4f and places the result back into point. The fourth element of the point input paramter is assumed to be one.
- Parameters:
point- the input point to be transformed.
public final void transform(Point3f point, Point3f pointOut)
Transforms the point parameter with this Matrix4f and places the result into pointOut. The fourth element of the point input paramter is assumed to be one.
- Parameters:
point- the input point to be transformed.pointOut- the transformed point
public final void transform(Tuple4f vec)
Transform the vector vec using this Matrix4f and place the result back into vec.
- Parameters:
vec- the single precision vector to be transformed
public final void transform(Tuple4f vec, Tuple4f vecOut)
Transform the vector vec using this Matrix4f and place the result into vecOut.
- Parameters:
vec- the single precision vector to be transformedvecOut- the vector into which the transformed values are placed
public final void transform(Vector3f normal)
Transforms the normal parameter by this transform and places the value back into normal. The fourth element of the normal is assumed to be zero.
- Parameters:
normal- the input normal to be transformed.
public final void transform(Vector3f normal, Vector3f normalOut)
Transforms the normal parameter by this Matrix4f and places the value into normalOut. The fourth element of the normal is assumed to be zero.
- Parameters:
normal- the input normal to be transformed.normalOut- the transformed normal
public final void transpose()
Sets the value of this matrix to its transpose.
public final void transpose(Matrix4f m1)
Sets the value of this matrix to the transpose of the argument matrix
- Parameters:
m1- the matrix to be transposed