|
||||||||||
| 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.Matrix3f
public class Matrix3f
A single precision floating point 3 by 3 matrix. Inspired by Kenji Hiranabe's Matrix3f implementation
| Field Summary | |
|---|---|
static Matrix3f |
IDENTITY
|
protected static int |
M
|
protected static int |
N
|
static Matrix3f |
ZERO
|
| Fields inherited from class org.openmali.vecmath2.MatrixMxNf |
|---|
colSkip, dataBegin, isDirty, roTrick, values |
| Constructor Summary | |
|---|---|
|
Matrix3f()
Constructs and initializes a Matrix3f to all zeros. |
protected |
Matrix3f(boolean readOnly)
Constructs and initializes a Matrix3f to all zeros. |
protected |
Matrix3f(boolean readOnly,
float[] values)
Constructs and initializes a Matrix3f from the specified 9 element array. |
protected |
Matrix3f(boolean readOnly,
float m00,
float m01,
float m02,
float m10,
float m11,
float m12,
float m20,
float m21,
float m22)
Constructs and initializes a Matrix3f from the specified nine values. |
protected |
Matrix3f(boolean readOnly,
int dataBegin,
int colSkip,
float[] values)
Hidden constructor for sharedSubMatrix3f(MatrixMxNf, int, int). |
protected |
Matrix3f(boolean readOnly,
Matrix3f mat)
Constructs a new matrix with the same values as the Matrix3f parameter. |
|
Matrix3f(float[] values)
Constructs and initializes a Matrix3f from the specified 9 element array. |
|
Matrix3f(float m00,
float m01,
float m02,
float m10,
float m11,
float m12,
float m20,
float m21,
float m22)
Constructs and initializes a Matrix3f from the specified nine values. |
protected |
Matrix3f(int dataBegin,
int colSkip,
float[] values)
Hidden constructor for sharedSubMatrix3f(MatrixMxNf, int, int). |
|
Matrix3f(Matrix3f mat)
Constructs a new matrix with the same values as the Matrix3f parameter. |
| Method Summary | |
|---|---|
void |
add(Matrix3f m2)
Sets the value of this matrix to sum of itself and matrix m2. |
void |
add(Matrix3f m1,
Matrix3f m2)
Sets the value of this matrix to the matrix sum of matrices m1 and m2. |
Matrix3f |
clone()
|
float |
determinant()
Computes the determinant of this matrix. |
boolean |
epsilonEquals(Matrix3f m2,
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(Matrix3f m2)
Returns true if all of the data members of Matrix3f m1 are equal to the corresponding data members in this Matrix3f. |
boolean |
equals(java.lang.Object o)
Returns true if the Object o1 is of type Matrix3f and all of the data members of t1 are equal to the corresponding data members in this Matrix3f. |
static Matrix3f |
fromPool()
Allocates an Matrix3f instance from the pool. |
Matrix3f |
getColumn(int column,
Tuple3f t3f)
Copies the matrix values in the specified column into the vector parameter. |
Matrix3f |
getRow(int row,
Tuple3f t3f)
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(Matrix3f m1,
Matrix3f m2,
float alpha)
Interpolates each value of this Matrix by the value alpha. |
Matrix3f |
invert()
Sets the value of this matrix to its inverse. |
void |
invert(Matrix3f mat)
Sets the value of this matrix to the matrix inverse of the passed matrix mat. |
float |
m00()
|
Matrix3f |
m00(float v)
|
float |
m01()
|
Matrix3f |
m01(float v)
|
float |
m02()
|
Matrix3f |
m02(float v)
|
float |
m10()
|
Matrix3f |
m10(float v)
|
float |
m11()
|
Matrix3f |
m11(float v)
|
float |
m12()
|
Matrix3f |
m12(float v)
|
float |
m20()
|
Matrix3f |
m20(float v)
|
float |
m21()
|
Matrix3f |
m21(float v)
|
float |
m22()
|
Matrix3f |
m22(float v)
|
Matrix3f |
mul(float scalar)
Multiplies this Matrix with a scalar. |
void |
mul(float scalar,
Matrix3f mat)
Multiplies each element of matrix m1 by a scalar and places the result into this. |
void |
mul(Matrix3f mat)
Sets the value of this matrix to the result of multiplying itself with matrix mat. |
void |
mul(Matrix3f mat1,
Matrix3f mat2)
Sets the value of this matrix to the result of multiplying the two argument matrices together. |
void |
mul(Tuple3f vec,
Tuple3f t3dOut)
|
void |
mulNormalize(Matrix3f mat)
Multiplies this matrix by matrix m1, does an SVD normalization of the result, and places the result back into this matrix this = SVDnorm(this * m1). |
void |
mulNormalize(Matrix3f mat1,
Matrix3f mat2)
Multiplies matrix m1 by matrix m2, does an SVD normalization of the result, and places the result into this matrix this = SVDnorm(m1*m2). |
void |
mulTransposeBoth(Matrix3f mat1,
Matrix3f mat2)
Multiplies the transpose of matrix m1 times the transpose of matrix m2, and places the result into this. |
void |
mulTransposeLeft(Matrix3f mat1,
Matrix3f mat2)
Multiplies the transpose of matrix m1 times matrix m2, and places the result into this. |
void |
mulTransposeRight(Matrix3f m1,
Matrix3f m2)
Multiplies matrix m1 times the transpose of matrix m2, and places the result into this. |
Matrix3f |
negate(Matrix3f mat)
Sets the value of this matrix equal to the negation of of the Matrix3f parameter. |
static Matrix3f |
newReadOnly()
Constructs and initializes a Matrix3f to all zeros. |
static Matrix3f |
newReadOnly(float[] values)
Constructs and initializes a Matrix3f from the specified 9 element array. |
static Matrix3f |
newReadOnly(float m00,
float m01,
float m02,
float m10,
float m11,
float m12,
float m20,
float m21,
float m22)
Constructs and initializes a Matrix3f from the specified nine values. |
static Matrix3f |
newReadOnly(Matrix3f mat)
Constructs a new matrix with the same values as the Matrix3f parameter. |
Matrix3f |
normalize()
Performs singular value decomposition normalization of this matrix. |
Matrix3f |
normalize(Matrix3f mat)
Perform singular value decomposition normalization of matrix m1 and place the normalized values into this. |
Matrix3f |
normalizeCP()
Performs cross product normalization of this matrix. |
Matrix3f |
normalizeCP(Matrix3f mat)
Performs cross product normalization of matrix m1 and place the normalized values into this. |
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. |
void |
set(AxisAngle3f aa3f)
Sets the value of this matrix to the matrix conversion of the single precision axis and angle argument. |
Matrix3f |
set(float scale)
Sets the value of this matrix to a scale matrix with the passed scale amount. |
Matrix3f |
set(float m00,
float m01,
float m02,
float m10,
float m11,
float m12,
float m20,
float m21,
float m22)
Sets 9 values |
void |
set(Quaternion4f quat)
Sets the value of this matrix to the matrix conversion of the (single precision) quaternion argument. |
Matrix3f |
setColumn(int column,
float x,
float y,
float z)
Sets the specified column of this matrix3d to the three values provided. |
Matrix3f |
setColumn(int column,
Tuple3f t3f)
Sets the specified column of this matrix3d to the vector provided. |
void |
setCross(Vector3f v)
Sets this matrix, so that this.transform(a) = v x a |
void |
setCross(Vector3f v,
boolean notInverted)
Sets this matrix, so that this.transform(a) = v x a by setting pos = false a negative version gets written |
Matrix3f |
setRow(int row,
float x,
float y,
float z)
Sets the specified row of this matrix3d to the three values provided. |
Matrix3f |
setRow(int row,
Tuple3f t3f)
Sets the specified row of this matrix3d to the Vector provided. |
static Matrix3f |
sharedSubMatrix3f(MatrixMxNf mat,
int beginRow,
int beginCol)
Creates a Submatrix of mat, that begins in beginRow and beginCol. |
void |
sub(Matrix3f m2)
Sets the value of this matrix to the matrix difference of itself and matrix m1 (this = this - m1). |
void |
sub(Matrix3f m1,
Matrix3f m2)
Sets the value of this matrix to the matrix difference of matrices m1 and m2. |
static void |
toPool(Matrix3f o)
Stores the given Matrix3f instance in the pool. |
void |
transform(Tuple3f t3f)
Transform the vector vec using this Matrix3f and place the result back into t3f. |
void |
transform(Tuple3f t3f,
Tuple3f result)
Transform the vector vec using this Matrix3f and place the result into vecOut. |
Matrix3f |
transpose(Matrix3f mat)
Sets the value of this matrix to the transpose of the argument matrix |
java.nio.FloatBuffer |
writeToBuffer(java.nio.FloatBuffer buffer)
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, get, getColumn, getColumn, getNumCols, getNumRows, getRow, getRow, 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, set, setClean, setColumn, setColumn, setIdentity, setRow, setRow, setScale, 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 Matrix3f ZERO
public static final Matrix3f IDENTITY
protected static final int M
protected static final int N
| Constructor Detail |
|---|
protected Matrix3f(boolean readOnly)
protected Matrix3f(boolean readOnly,
float m00,
float m01,
float m02,
float m10,
float m11,
float m12,
float m20,
float m21,
float m22)
m00 - the [0][0] elementm01 - the [0][1] elementm02 - the [0][2] elementm10 - the [1][0] elementm11 - the [1][1] elementm12 - the [1][2] elementm20 - the [2][0] elementm21 - the [2][1] elementm22 - the [2][2] element
protected Matrix3f(boolean readOnly,
float[] values)
values - the array of length 9 containing in order
protected Matrix3f(boolean readOnly,
Matrix3f mat)
mat - The source matrix.
protected Matrix3f(boolean readOnly,
int dataBegin,
int colSkip,
float[] values)
sharedSubMatrix3f(MatrixMxNf, int, int).
dataBegin - colSkip - values - sharedSubMatrix3f(MatrixMxNf, int, int),
MatrixMxNf.MatrixMxNf(int, int, int, int, float[])public Matrix3f()
public Matrix3f(float m00,
float m01,
float m02,
float m10,
float m11,
float m12,
float m20,
float m21,
float m22)
m00 - the [0][0] elementm01 - the [0][1] elementm02 - the [0][2] elementm10 - the [1][0] elementm11 - the [1][1] elementm12 - the [1][2] elementm20 - the [2][0] elementm21 - the [2][1] elementm22 - the [2][2] elementpublic Matrix3f(float[] values)
values - the array of length 9 containing in orderpublic Matrix3f(Matrix3f mat)
mat - The source matrix.
protected Matrix3f(int dataBegin,
int colSkip,
float[] values)
sharedSubMatrix3f(MatrixMxNf, int, int).
dataBegin - colSkip - values - sharedSubMatrix3f(MatrixMxNf, int, int),
MatrixMxNf.MatrixMxNf(int, int, int, int, float[])| Method Detail |
|---|
public final float m00()
public final float m01()
public final float m02()
public final float m10()
public final float m11()
public final float m12()
public final float m20()
public final float m21()
public final float m22()
public final Matrix3f m00(float v)
public final Matrix3f m01(float v)
public final Matrix3f m02(float v)
public final Matrix3f m10(float v)
public final Matrix3f m11(float v)
public final Matrix3f m12(float v)
public final Matrix3f m20(float v)
public final Matrix3f m21(float v)
public final Matrix3f m22(float v)
public final Matrix3f setRow(int row,
float x,
float y,
float z)
row - the row number to be modified (zero indexed)x - the first column elementy - the second column elementz - the third column element
public final Matrix3f setRow(int row,
Tuple3f t3f)
row - the row number to be modified (zero indexed)t3f - the replacement row
public final Matrix3f getRow(int row,
Tuple3f t3f)
row - the matrix rowt3f - The vector into which the matrix row values will be copied
public final Matrix3f setColumn(int column,
float x,
float y,
float z)
column - the column number to be modified (zero indexed)x - the first row elementy - the second row elementz - the third row element
public final Matrix3f setColumn(int column,
Tuple3f t3f)
column - the column number to be modified (zero indexed)t3f - the replacement column
public final Matrix3f getColumn(int column,
Tuple3f t3f)
column - the matrix columnt3f - The vector into which the matrix row values will be copied
public final Matrix3f set(float scale)
scale - the scale factor for the matrix
public final float getScale()
public final void set(Quaternion4f quat)
quat - the quaternion to be convertedpublic final void set(AxisAngle3f aa3f)
aa3f - the axis and angle to be converted
public final Matrix3f set(float m00,
float m01,
float m02,
float m10,
float m11,
float m12,
float m20,
float m21,
float m22)
m00 - m01 - m02 - m10 - m11 - m12 - m20 - m21 - m22 -
public java.nio.FloatBuffer writeToBuffer(java.nio.FloatBuffer buffer)
buffer -
public final Matrix3f negate(Matrix3f mat)
mat - The source matrix
public final float determinant()
public final Matrix3f normalize()
public final Matrix3f normalize(Matrix3f mat)
mat - Provides the matrix values to be normalized
public final Matrix3f normalizeCP()
public final Matrix3f normalizeCP(Matrix3f mat)
mat - Provides the matrix values to be normalized
public final Matrix3f transpose(Matrix3f mat)
mat - the matrix to be transposed
public Matrix3f mul(float scalar)
mul in class MatrixMxNfpublic Matrix3f invert()
invert in class MatrixMxNfpublic final void invert(Matrix3f mat)
mat - the matrix to be inverted
public final void transform(Tuple3f t3f,
Tuple3f result)
t3f - the single precision vector to be transformedresult - the vector into which the transformed values are placedpublic final void transform(Tuple3f t3f)
t3f - the single precision vector to be transformed
public final void add(Matrix3f m1,
Matrix3f m2)
m1 - the first matrixm2 - the second matrixpublic final void add(Matrix3f m2)
m2 - the other matrix
public final void sub(Matrix3f m1,
Matrix3f m2)
m1 - the first matrixm2 - the second matrixpublic final void sub(Matrix3f m2)
m2 - the other matrixpublic 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 radians
public final void mul(float scalar,
Matrix3f mat)
scalar - The scalar multiplier.mat - The original matrix.
public final void mul(Matrix3f mat1,
Matrix3f mat2)
mat1 - the first matrixmat2 - the second matrixpublic final void mul(Matrix3f mat)
mat - the other matrix
public final void mul(Tuple3f vec,
Tuple3f t3dOut)
public final void mulNormalize(Matrix3f mat)
mat - the matrix on the right hand side of the multiplication
public final void mulNormalize(Matrix3f mat1,
Matrix3f 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 mulTransposeBoth(Matrix3f mat1,
Matrix3f 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 mulTransposeRight(Matrix3f m1,
Matrix3f m2)
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(Matrix3f mat1,
Matrix3f mat2)
mat1 - The matrix on the left hand side of the multiplicationmat2 - The matrix on the right hand side of the multiplicationpublic final void setCross(Vector3f v)
v - the vector to compute the crossproduct to
public final void setCross(Vector3f v,
boolean notInverted)
v - the vector to compute the crossproduct tonotInverted - if true positive version or false to get a negative one
public void interpolate(Matrix3f m1,
Matrix3f m2,
float alpha)
m1 - m2 - alpha - public int hashCode()
hashCode in class MatrixMxNfpublic boolean equals(Matrix3f m2)
m2 - 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(Matrix3f m2,
float epsilon)
m2 - The matrix to be compared to this matrixepsilon - the threshold valuepublic Matrix3f clone()
clone in class MatrixMxNfpublic static Matrix3f newReadOnly()
public static Matrix3f newReadOnly(float m00,
float m01,
float m02,
float m10,
float m11,
float m12,
float m20,
float m21,
float m22)
m00 - the [0][0] elementm01 - the [0][1] elementm02 - the [0][2] elementm10 - the [1][0] elementm11 - the [1][1] elementm12 - the [1][2] elementm20 - the [2][0] elementm21 - the [2][1] elementm22 - the [2][2] elementpublic static Matrix3f newReadOnly(float[] values)
values - the array of length 9 containing in orderpublic static Matrix3f newReadOnly(Matrix3f mat)
mat - The source matrix.
public static Matrix3f sharedSubMatrix3f(MatrixMxNf mat,
int beginRow,
int beginCol)
mat - the parent matrixbeginRow - the row to start this matrix atbeginCol - the column to start this matrix at
Matrix3f(int, int, float[])public static Matrix3f fromPool()
public static void toPool(Matrix3f o)
o -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||