|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openmali.vecmath2.MatrixMxNf
org.openmali.vecmath2.Matrix4f
public class Matrix4f
A single precision floating point 4 by 4 matrix. Inspired by Kenji Hiranabe's GMatrix implementation
| Field Summary | |
|---|---|
static Matrix4f |
IDENTITY
|
protected static int |
M
|
protected static int |
N
|
static Matrix4f |
ROT_MINUS_90_DEG_BY_X_AXIS
|
static Matrix4f |
ROT_MINUS_90_DEG_BY_Y_AXIS
|
static Matrix4f |
ROT_MINUS_90_DEG_BY_Z_AXIS
|
static Matrix4f |
ROT_PLUS_90_DEG_BY_X_AXIS
|
static Matrix4f |
ROT_PLUS_90_DEG_BY_Y_AXIS
|
static Matrix4f |
ROT_PLUS_90_DEG_BY_Z_AXIS
|
static Matrix4f |
Z_UP_TO_Y_UP
|
static Matrix4f |
ZERO
|
| Fields inherited from class org.openmali.vecmath2.MatrixMxNf |
|---|
colSkip, dataBegin, isDirty, roTrick, values |
| Constructor Summary | |
|---|---|
|
Matrix4f()
Constructs and initializes a Matrix4f to all zeros. |
protected |
Matrix4f(boolean readOnly)
Constructs and initializes a Matrix4f to all zeros. |
protected |
Matrix4f(boolean readOnly,
float[] values)
Constructs and initializes a Matrix4f from the specified 16 element array. this.m00 =v[0], this.m01=v[1], etc. |
protected |
Matrix4f(boolean readOnly,
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. |
protected |
Matrix4f(boolean readOnly,
int dataBegin,
int colSkip,
float[] values,
boolean[] isDirty)
Hidden constructor for #sharedSubMatrix3f(MatrixMxNf, int, int). |
protected |
Matrix4f(boolean readOnly,
Matrix3f mat)
Constructs a new matrix with the same values as the Matrix3f parameter. |
protected |
Matrix4f(boolean readOnly,
Matrix4f mat)
Constructs a new matrix with the same values as the Matrix4f parameter. |
protected |
Matrix4f(boolean readOnly,
Quaternion4f rot,
Tuple3f pos,
float scale)
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. |
protected |
Matrix4f(boolean readOnly,
Tuple3f pos,
Matrix3f rot,
float scale)
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. |
|
Matrix4f(float[] values)
Constructs and initializes a Matrix4f from the specified 16 element array. this.m00 =v[0], this.m01=v[1], etc. |
|
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. |
protected |
Matrix4f(int dataBegin,
int colSkip,
float[] values,
boolean[] isDirty)
Hidden constructor for #sharedSubMatrix3f(MatrixMxNf, int, int). |
|
Matrix4f(Matrix3f mat)
Constructs a new matrix with the same values as the Matrix3f parameter. |
|
Matrix4f(Matrix4f mat)
Constructs a new matrix with the same values as the Matrix4f parameter. |
|
Matrix4f(Quaternion4f rot,
Tuple3f pos,
float scale)
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. |
|
Matrix4f(Tuple3f pos,
Matrix3f rot,
float scale)
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. |
| Method Summary | |
|---|---|
Matrix4f |
add(float scalar,
Matrix4f mat)
Adds a scalar to each component of the matrix m1 and places the result into this. |
Matrix4f |
add(Matrix4f mat2)
Sets the value of this matrix to sum of itself and matrix m1. |
Matrix4f |
add(Matrix4f mat1,
Matrix4f mat2)
Sets the value of this matrix to the matrix sum of matrices m1 and m2. |
Matrix4f |
asReadOnly()
|
Matrix4f |
clone()
|
float |
determinant()
Computes the determinant of this matrix. |
boolean |
epsilonEquals(Matrix4f mat2,
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. |
boolean |
equals(Matrix4f mat2)
Returns true if all of the data members of Matrix4f m1 are equal to the corresponding data members in this Matrix4f. |
boolean |
equals(java.lang.Object o)
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. |
static Matrix4f |
fromPool()
Allocates an Matrix4f instance from the pool. |
void |
get(Matrix3f mat)
Performs an SVD normalization of this matrix in order to acquire the normalized rotational component; the values are placed into the Matrix3f parameter. |
float |
get(Matrix3f mat,
Tuple3f pos)
Performs an SVD normalization of this matrix to calculate the rotation as a 3x3 matrix, the translation, and the scale. |
void |
get(Quaternion4f quat)
Performs an SVD normalization of this matrix in order to acquire the normalized rotational component; the values are placed into the Quat4f parameter. |
void |
get(Tuple3f trans)
Retrieves the translational components of this matrix. |
void |
getColumn(int column,
Vector4f buffer)
Copies the matrix values in the specified column into the vector parameter. |
Matrix4f |
getReadOnly()
|
void |
getRotationScale(Matrix3f mat)
Gets the upper 3x3 values of this matrix and places them into the matrix mat. |
Matrix4f |
getRow(int row,
Vector4f buffer)
Copies the matrix values in the specified row into the vector parameter. |
float |
getScale()
Performs an SVD normalization of this matrix to calculate and return the uniform scale factor. |
int |
hashCode()
Returns a hash number based on the data values in this object. |
void |
interpolate(Matrix4f m1,
Matrix4f m2,
float alpha)
Interpolates each value of this Matrix by the value alpha. |
void |
interpolate(Matrix4f m1,
Matrix4f m2,
float alpha,
boolean interpolateLastLine)
Interpolates each value of this Matrix by the value alpha. |
Matrix4f |
invert()
Inverts this matrix in place. |
Matrix4f |
invert(Matrix4f mat)
Sets the value of this matrix to the matrix inverse of the passed matrix m1. |
float |
m00()
|
Matrix4f |
m00(float v)
|
float |
m01()
|
Matrix4f |
m01(float v)
|
float |
m02()
|
Matrix4f |
m02(float v)
|
float |
m03()
|
Matrix4f |
m03(float v)
|
float |
m10()
|
Matrix4f |
m10(float v)
|
float |
m11()
|
Matrix4f |
m11(float v)
|
float |
m12()
|
Matrix4f |
m12(float v)
|
float |
m13()
|
Matrix4f |
m13(float v)
|
float |
m20()
|
Matrix4f |
m20(float v)
|
float |
m21()
|
Matrix4f |
m21(float v)
|
float |
m22()
|
Matrix4f |
m22(float v)
|
float |
m23()
|
Matrix4f |
m23(float v)
|
float |
m30()
|
Matrix4f |
m30(float v)
|
float |
m31()
|
Matrix4f |
m31(float v)
|
float |
m32()
|
Matrix4f |
m32(float v)
|
float |
m33()
|
Matrix4f |
m33(float v)
|
Matrix4f |
mul(float scalar)
Multiplies this Matrix with a scalar. |
Matrix4f |
mul(float scalar,
Matrix4f mat)
Multiplies each element of matrix m1 by a scalar and places the result into this. |
Matrix4f |
mul(Matrix4f mat)
Sets the value of this matrix to the result of multiplying itself with matrix mat. |
Matrix4f |
mul(Matrix4f mat1,
Matrix4f mat2)
Sets the value of this matrix to the result of multiplying the two argument matrices together. |
Matrix4f |
mulTransposeBoth(Matrix4f mat1,
Matrix4f mat2)
Multiplies the transpose of matrix m1 times the transpose of matrix m2, and places the result into this. |
Matrix4f |
mulTransposeLeft(Matrix4f mat1,
Matrix4f mat2)
Multiplies the transpose of matrix m1 times matrix m2, and places the result into this. |
Matrix4f |
mulTransposeRight(Matrix4f mat1,
Matrix4f mat2)
Multiplies matrix m1 times the transpose of matrix m2, and places the result into this. |
Matrix4f |
negate(Matrix4f m1)
Sets the value of this matrix equal to the negation of of the Matrix4f parameter. |
static Matrix4f |
newReadOnly()
Constructs and initializes a Matrix4f to all zeros. |
static Matrix4f |
newReadOnly(float[] values)
Constructs and initializes a Matrix4f from the specified 16 element array. this.m00 =v[0], this.m01=v[1], etc. |
static Matrix4f |
newReadOnly(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. |
static Matrix4f |
newReadOnly(Matrix3f mat)
Constructs a new matrix with the same values as the Matrix3f parameter. |
static Matrix4f |
newReadOnly(Matrix4f mat)
Constructs a new matrix with the same values as the Matrix4f parameter. |
static Matrix4f |
newReadOnly(Quaternion4f rot,
Tuple3f pos,
float scale)
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. |
static Matrix4f |
newReadOnly(Tuple3f pos,
Matrix3f rot,
float scale)
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. |
java.nio.FloatBuffer |
readFromBuffer(java.nio.FloatBuffer buffer)
Reads the contents of this matrix column-wise from a FloatBuffer. |
java.nio.FloatBuffer |
readFromBuffer(java.nio.FloatBuffer buffer,
int position)
Reads the contents of this matrix column-wise from a FloatBuffer. |
static java.nio.FloatBuffer |
readFromBuffer(Matrix4f[] matrices,
java.nio.FloatBuffer buffer)
Reads the contents of this matrix column-wise from a FloatBuffer. |
static java.nio.FloatBuffer |
readFromBuffer(Matrix4f[] matrices,
java.nio.FloatBuffer buffer,
int position)
Reads the contents of this matrix column-wise from a FloatBuffer. |
Matrix4f |
rotX(float angle)
Sets the value of this matrix to a rotation matrix about the x axis by the passed angle. |
Matrix4f |
rotY(float angle)
Sets the value of this matrix to a rotation matrix about the y axis by the passed angle. |
Matrix4f |
rotZ(float angle)
Sets the value of this matrix to a rotation matrix about the z axis by the passed angle. |
Matrix4f |
set(AxisAngle3f aa3f)
Sets the value of this matrix to the matrix conversion of the single precision axis and angle argument. |
Matrix4f |
set(float scale)
Sets the value of this matrix to a scale matrix with the passed scale amount. |
Matrix4f |
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 |
Matrix4f |
set(float scale,
Tuple3f pos)
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. |
void |
set(Matrix3f mat)
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). |
Matrix4f |
set(Matrix3f mat,
Tuple3f pos,
float scale)
Sets the value of this matrix from the rotation expressed by the rotation matrix m1, the translation t1, and the scale s. |
Matrix4f |
set(Quaternion4f quat)
Sets the value of this matrix to the matrix conversion of the single precision quaternion argument. |
Matrix4f |
set(Quaternion4f quat,
Tuple3f pos,
float scale)
Sets the value of this matrix from the rotation expressed by the quaternion q1, the translation t1, and the scale s. |
Matrix4f |
set(Tuple3f pos)
Sets the value of this matrix to a translate matrix by the passed translation value. |
Matrix4f |
set(Tuple3f pos,
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. |
Matrix4f |
setColumn(int column,
float x,
float y,
float z,
float w)
Sets the specified column of this matrix4f to the four values provided. |
Matrix4f |
setColumn(int column,
Vector4f values)
Sets the specified column of this matrix4f to the vector provided. |
Matrix4f |
setInvRotation(Tuple3f tup)
Builds an inverse rotation matrix. |
Matrix4f |
setRotation(AxisAngle3f aa)
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. |
Matrix4f |
setRotation(Matrix3f mat)
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. |
Matrix4f |
setRotation(Quaternion4f quat)
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. |
Matrix4f |
setRotation(Tuple3f tup)
Builds a rotation matrix. |
Matrix4f |
setRotationScale(Matrix3f mat)
Replaces the upper 3x3 matrix values of this matrix with the values in the matrix mat. |
Matrix4f |
setRow(int row,
float x,
float y,
float z,
float w)
Sets the specified row of this Matrix4f to the four values provided. |
Matrix4f |
setRow(int row,
Vector4f values)
Sets the specified row of this matrix4f to the Vector provided. |
Matrix4f |
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. |
Matrix4f |
setTranslation(float transX,
float transY,
float transZ)
Modifies the translational components of this matrix to the values of the Vector3f argument; the other values of this matrix are not modified. |
Matrix4f |
setTranslation(Tuple3f trans)
Modifies the translational components of this matrix to the values of the Vector3f argument; the other values of this matrix are not modified. |
static Matrix4f |
sharedSubMatrix4f(MatrixMxNf mat,
int beginRow,
int beginCol)
Creates a Submatrix of mat, that begins in beginRow and beginCol. |
Matrix4f |
sub(Matrix4f mat2)
Sets the value of this matrix to the matrix difference of itself and matrix m1 (this = this - m1). |
Matrix4f |
sub(Matrix4f mat1,
Matrix4f mat2)
Sets the value of this matrix to the matrix difference of matrices m1 and m2. |
static void |
toPool(Matrix4f o)
Stores the given Matrix3f instance in the pool. |
void |
transform(Point3f point)
Transforms the point parameter with this Matrix4f and places the result back into point. |
void |
transform(Point3f point,
Point3f pointOut)
Transforms the point parameter with this Matrix4f and places the result into pointOut. |
void |
transform(Vector3f vec)
Transforms the normal parameter by this transform and places the value back into normal. |
void |
transform(Vector3f vec,
Vector3f vecOut)
Transforms the normal parameter by this Matrix4f and places the value into normalOut. |
void |
transform(Vector4f vec)
Transform the vector vec using this Matrix4f and place the result back into vec. |
void |
transform(Vector4f vec,
Vector4f vecOut)
Transform the vector vec using this Matrix4f and place the result into vecOut. |
Matrix4f |
transpose(Matrix4f mat)
Sets the value of this matrix to the transpose of the argument matrix |
java.nio.FloatBuffer |
writeToBuffer(java.nio.FloatBuffer buffer,
boolean clear,
boolean flip)
Writes the contents of this matrix column-wise to a FloatBuffer. |
java.nio.FloatBuffer |
writeToBuffer(java.nio.FloatBuffer buffer,
int position,
boolean clear,
boolean flip)
Writes the contents of this matrix column-wise to a FloatBuffer. |
static java.nio.FloatBuffer |
writeToBuffer(Matrix4f[] matrices,
java.nio.FloatBuffer buffer,
boolean clear,
boolean flip)
Writes the contents of this matrix column-wise to a FloatBuffer. |
static java.nio.FloatBuffer |
writeToBuffer(Matrix4f[] matrices,
java.nio.FloatBuffer buffer,
int position,
boolean clear,
boolean flip)
Writes the contents of this matrix column-wise to a FloatBuffer. |
| Methods inherited from class org.openmali.vecmath2.MatrixMxNf |
|---|
add, add, add, add, cond, copySubMatrix, deserialize, div, epsilonEquals, equals, get, get, get, get, getColumn, getColumn, getColumnMajor, getColumnMajor, getNumCols, getNumRows, getRow, getRow, getRowMajor, getRowMajor, getSerializationBufferSize, getSharedSubMatrix, getSharedSubMatrix, identityMinus, interpolate, invert, isDirty, isPositiveDefinite, isPositiveDefinite, isReadOnly, isSquare, isSubMatrix, LUD, mul, mul, mul, mul, mulComp, mulComp, mulTransposeBoth, mulTransposeLeft, mulTransposeRight, negate, negate, newReadOnly, newReadOnly, newReadOnly, norm1, norm2, normFrobenius, normInfinity, rank, readExternal, serialize, set, set, set, set, setClean, setColumn, setColumn, setColumnMajor, setColumnMajor, setIdentity, setRow, setRow, setRowMajor, setRowMajor, setZero, sharedSubMatrixMxNf, sharedSubMatrixMxNf, solve, solve, sub, sub, sub, sub, SVD, toString, trace, transpose, transpose, writeExternal |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.io.Externalizable |
|---|
readExternal, writeExternal |
| Field Detail |
|---|
public static final Matrix4f ZERO
public static final Matrix4f IDENTITY
public static final Matrix4f ROT_PLUS_90_DEG_BY_X_AXIS
public static final Matrix4f ROT_MINUS_90_DEG_BY_X_AXIS
public static final Matrix4f ROT_PLUS_90_DEG_BY_Y_AXIS
public static final Matrix4f ROT_MINUS_90_DEG_BY_Y_AXIS
public static final Matrix4f ROT_PLUS_90_DEG_BY_Z_AXIS
public static final Matrix4f ROT_MINUS_90_DEG_BY_Z_AXIS
public static final Matrix4f Z_UP_TO_Y_UP
protected static final int M
protected static final int N
| Constructor Detail |
|---|
protected Matrix4f(boolean readOnly)
readOnly -
protected Matrix4f(boolean readOnly,
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)
readOnly - 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
protected Matrix4f(boolean readOnly,
float[] values)
readOnly - values - the array of length 16 containing in order
protected Matrix4f(boolean readOnly,
Quaternion4f rot,
Tuple3f pos,
float scale)
readOnly - rot - The quaternion value representing the rotational componentpos - The translational component of the matrixscale - The scale value applied to the rotational components
protected Matrix4f(boolean readOnly,
Tuple3f pos,
Matrix3f rot,
float scale)
readOnly - pos - The translational components of the matrixrot - The rotation matrix representing the rotational componentsscale - The scale value applied to the rotational components
protected Matrix4f(boolean readOnly,
Matrix4f mat)
readOnly - mat - The source matrix.
protected Matrix4f(boolean readOnly,
Matrix3f mat)
readOnly - mat - The source matrix.
protected Matrix4f(boolean readOnly,
int dataBegin,
int colSkip,
float[] values,
boolean[] isDirty)
readOnly - dataBegin - colSkip - values - isDirty - public Matrix4f()
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)
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] elementpublic Matrix4f(float[] values)
values - the array of length 16 containing in order
public Matrix4f(Quaternion4f rot,
Tuple3f pos,
float scale)
rot - The quaternion value representing the rotational componentpos - The translational component of the matrixscale - The scale value applied to the rotational components
public Matrix4f(Tuple3f pos,
Matrix3f rot,
float scale)
pos - The translational components of the matrixrot - The rotation matrix representing the rotational componentsscale - The scale value applied to the rotational componentspublic Matrix4f(Matrix4f mat)
mat - The source matrix.public Matrix4f(Matrix3f mat)
mat - The source matrix.
protected Matrix4f(int dataBegin,
int colSkip,
float[] values,
boolean[] isDirty)
dataBegin - colSkip - values - isDirty - | Method Detail |
|---|
public final float m00()
public final float m01()
public final float m02()
public final float m03()
public final float m10()
public final float m11()
public final float m12()
public final float m13()
public final float m20()
public final float m21()
public final float m22()
public final float m23()
public final float m30()
public final float m31()
public final float m32()
public final float m33()
public final Matrix4f m00(float v)
public final Matrix4f m01(float v)
public final Matrix4f m02(float v)
public final Matrix4f m03(float v)
public final Matrix4f m10(float v)
public final Matrix4f m11(float v)
public final Matrix4f m12(float v)
public final Matrix4f m13(float v)
public final Matrix4f m20(float v)
public final Matrix4f m21(float v)
public final Matrix4f m22(float v)
public final Matrix4f m23(float v)
public final Matrix4f m30(float v)
public final Matrix4f m31(float v)
public final Matrix4f m32(float v)
public final Matrix4f m33(float v)
public final Matrix4f 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 -
public final Matrix4f set(float scale)
scale - the scale factor for the matrix
public void set(Matrix3f mat)
set in class MatrixMxNfmat - the 3x3 matrixpublic final Matrix4f set(Tuple3f pos)
pos - the translation amount
public final Matrix4f set(float scale,
Tuple3f pos)
scale - the scale factor for the matrixpos - the translation amount
public final Matrix4f set(Tuple3f pos,
float scale)
pos - the translation amountscale - the scale factor for the matrix
public final Matrix4f set(Matrix3f mat,
Tuple3f pos,
float scale)
mat - The rotation componentpos - The translation componentscale - The scale component
public final Matrix4f setTranslation(float transX,
float transY,
float transZ)
transX - the translational x-componenttransY - the translational y-componenttransZ - the translational z-component
public final Matrix4f setTranslation(Tuple3f trans)
trans - the translational component
public final Matrix4f set(Quaternion4f quat)
quat - the quaternion to be converted
public final Matrix4f set(AxisAngle3f aa3f)
aa3f - the axis and angle to be converted
public final Matrix4f set(Quaternion4f quat,
Tuple3f pos,
float scale)
quat - the rotation expressed as a quaternionpos - the translationscale - the scale value
public final Matrix4f setScale(float scale)
setScale in class MatrixMxNfscale - the new scale amount
public final void get(Matrix3f mat)
get in class MatrixMxNfmat - matrix into which the rotational component is placed
public final float get(Matrix3f mat,
Tuple3f pos)
mat - The normalized matrix representing the rotationpos - The translation component
public final void get(Quaternion4f quat)
quat - quaternion into which the rotation component is placed
public java.nio.FloatBuffer writeToBuffer(java.nio.FloatBuffer buffer,
boolean clear,
boolean flip)
buffer - clear - clear the buffer before writing data?flip - flip the buffer after writing data?
public java.nio.FloatBuffer writeToBuffer(java.nio.FloatBuffer buffer,
int position,
boolean clear,
boolean flip)
buffer - position - position in the bufferclear - clear the buffer before writing data?flip - flip the buffer after writing data?
public static java.nio.FloatBuffer writeToBuffer(Matrix4f[] matrices,
java.nio.FloatBuffer buffer,
boolean clear,
boolean flip)
matrices - buffer - clear - clear the buffer before writing data?flip - flip the buffer after writing data?
public static java.nio.FloatBuffer writeToBuffer(Matrix4f[] matrices,
java.nio.FloatBuffer buffer,
int position,
boolean clear,
boolean flip)
matrices - buffer - position - position in the bufferclear - clear the buffer before writing data?flip - flip the buffer after writing data?
public java.nio.FloatBuffer readFromBuffer(java.nio.FloatBuffer buffer)
buffer -
public java.nio.FloatBuffer readFromBuffer(java.nio.FloatBuffer buffer,
int position)
buffer - position - position in the buffer
public static java.nio.FloatBuffer readFromBuffer(Matrix4f[] matrices,
java.nio.FloatBuffer buffer)
matrices - buffer -
public static java.nio.FloatBuffer readFromBuffer(Matrix4f[] matrices,
java.nio.FloatBuffer buffer,
int position)
matrices - buffer - position - position in the buffer
public final void get(Tuple3f trans)
trans - the vector that will receive the translational componentpublic final void getRotationScale(Matrix3f mat)
mat - The matrix that will hold the valuespublic final float getScale()
public final Matrix4f setRotationScale(Matrix3f mat)
mat - The matrix that will be the new upper 3x3
public final Matrix4f setRow(int row,
float x,
float y,
float z,
float w)
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 Matrix4f setRow(int row,
Vector4f values)
row - the row number to be modified (zero indexed)values - the replacement row
public final Matrix4f getRow(int row,
Vector4f buffer)
row - the matrix rowbuffer - The vector into which the matrix row values will be copied
public final Matrix4f setColumn(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 element
public final Matrix4f setColumn(int column,
Vector4f values)
column - the column number to be modified (zero indexed)values - the replacement column
public final void getColumn(int column,
Vector4f buffer)
column - the matrix columnbuffer - The vector into which the matrix column values will be copiedpublic final float determinant()
public final Matrix4f transpose(Matrix4f mat)
mat - the matrix to be transposed
public final Matrix4f negate(Matrix4f m1)
m1 - The source matrix
public Matrix4f invert()
invert in class MatrixMxNfpublic final Matrix4f invert(Matrix4f mat)
mat - the matrix to be inverted
public final Matrix4f add(float scalar,
Matrix4f mat)
scalar - The scalar adder.mat - The original matrix values.
public final Matrix4f add(Matrix4f mat1,
Matrix4f mat2)
mat1 - the first matrixmat2 - the second matrix
public final Matrix4f add(Matrix4f mat2)
mat2 - the other matrix
public final Matrix4f sub(Matrix4f mat2)
mat2 - the other matrix
public final Matrix4f sub(Matrix4f mat1,
Matrix4f mat2)
mat1 - the first matrixmat2 - the second matrix
public final Matrix4f rotX(float angle)
angle - the angle to rotate about the X axis in radians
public final Matrix4f rotY(float angle)
angle - the angle to rotate about the Y axis in radians
public final Matrix4f rotZ(float angle)
angle - the angle to rotate about the Z axis in radians
public Matrix4f mul(float scalar)
mul in class MatrixMxNf
public final Matrix4f mul(float scalar,
Matrix4f mat)
scalar - The scalar multiplier.mat - The original matrix.
public final Matrix4f mul(Matrix4f mat)
mat - the other matrix
public Matrix4f mul(Matrix4f mat1,
Matrix4f mat2)
mat1 - the first matrixmat2 - the second matrix
public final Matrix4f mulTransposeBoth(Matrix4f mat1,
Matrix4f mat2)
mat1 - The matrix on the left hand side of the multiplicationmat2 - The matrix on the right hand side of the multiplication
public final Matrix4f mulTransposeLeft(Matrix4f mat1,
Matrix4f mat2)
mat1 - The matrix on the left hand side of the multiplicationmat2 - The matrix on the right hand side of the multiplication
public final Matrix4f mulTransposeRight(Matrix4f mat1,
Matrix4f mat2)
mat1 - The matrix on the left hand side of the multiplicationmat2 - The matrix on the right hand side of the multiplication
public final void transform(Vector4f vec,
Vector4f vecOut)
vec - the single precision vector to be transformedvecOut - the vector into which the transformed values are placedpublic final void transform(Vector4f vec)
vec - the single precision vector to be transformed
public final void transform(Point3f point,
Point3f pointOut)
point - the input point to be transformed.pointOut - the transformed pointpublic final void transform(Point3f point)
point - the input point to be transformed.
public final void transform(Vector3f vec,
Vector3f vecOut)
vec - the input normal to be transformed.vecOut - the transformed normalpublic final void transform(Vector3f vec)
vec - the input normal to be transformed.public final Matrix4f setRotation(Matrix3f mat)
mat - single precision 3x3 matrix
public final Matrix4f setRotation(Quaternion4f quat)
quat - the quaternion that specifies the rotation
public final Matrix4f setRotation(AxisAngle3f aa)
aa - the axis-angle to be converted (x, y, z, angle)
public final Matrix4f setRotation(Tuple3f tup)
tup -
public final Matrix4f setInvRotation(Tuple3f tup)
tup -
public void interpolate(Matrix4f m1,
Matrix4f m2,
float alpha,
boolean interpolateLastLine)
m1 - m2 - alpha - interpolateLastLine -
public final void interpolate(Matrix4f m1,
Matrix4f m2,
float alpha)
m1 - m2 - alpha - public int hashCode()
hashCode in class MatrixMxNfpublic boolean equals(Matrix4f mat2)
mat2 - The matrix with which the comparison is made.
public boolean equals(java.lang.Object o)
equals in class MatrixMxNfo - the object with which the comparison is made.
public boolean epsilonEquals(Matrix4f mat2,
float epsilon)
mat2 - The matrix to be compared to this matrixepsilon - the threshold valuepublic Matrix4f clone()
clone in class MatrixMxNfpublic Matrix4f asReadOnly()
asReadOnly in class MatrixMxNfMatrixMxNf.getReadOnly()public Matrix4f getReadOnly()
getReadOnly in class MatrixMxNfMatrixMxNf.asReadOnly()public static Matrix4f newReadOnly()
public static Matrix4f newReadOnly(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 - 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] elementpublic static Matrix4f newReadOnly(float[] values)
values - the array of length 16 containing in order
public static Matrix4f newReadOnly(Quaternion4f rot,
Tuple3f pos,
float scale)
rot - The quaternion value representing the rotational componentpos - The translational component of the matrixscale - The scale value applied to the rotational components
public static Matrix4f newReadOnly(Tuple3f pos,
Matrix3f rot,
float scale)
pos - The translational components of the matrixrot - The rotation matrix representing the rotational componentsscale - The scale value applied to the rotational componentspublic static Matrix4f newReadOnly(Matrix4f mat)
mat - The source matrix.public static Matrix4f newReadOnly(Matrix3f mat)
mat - The source matrix.
public static Matrix4f sharedSubMatrix4f(MatrixMxNf mat,
int beginRow,
int beginCol)
mat - the parent matrixbeginRow - the row to start this matrix atbeginCol - the column to start this matrix at
#Matrix4f(int, int, float[])public static Matrix4f fromPool()
public static void toPool(Matrix4f o)
o -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||