|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.math.Mat3f
public final class Mat3f
A collection of static methods for 3 X 3 matrices, represented by float arrays of length 9. Matrices are stored in row-major order, i.e., the first three elements represent the first row, the next three represent the second row etcetera. Note that this deviates from the OpenGL order.
| Nested Class Summary | |
|---|---|
static class |
Mat3f.ScalingType
Restored for compatibility with Herwin's demos, do not remove |
| Field Summary | |
|---|---|
static int |
COL_SIZE
|
static double |
DEGREEPERRAD
|
static int |
M00
|
static int |
M01
|
static int |
M02
|
static int |
M10
|
static int |
M11
|
static int |
M12
|
static int |
M20
|
static int |
M21
|
static int |
M22
|
static int |
MAT3F_SIZE
|
private static float |
MINIMAL_SKEW_ANGLE
|
private static float |
NORMALIZE_THRESHOLD
|
private static float |
POLARDECOMPOSESMOOTHFACTOR
|
static int |
ROW_SIZE
|
static float |
TOL
|
| Constructor Summary | |
|---|---|
private |
Mat3f()
|
| Method Summary | |
|---|---|
static void |
add(float[] dest,
float[] a)
dest += a |
static void |
add(float[] dest,
float[] a,
float[] b)
dest = a+b |
static void |
add(float[] dest,
int destIndex,
float[] a,
int aIndex)
dest += b |
static void |
add(float[] dest,
int destIndex,
float[] a,
int aIndex,
float[] b,
int bIndex)
dest = a+b |
static float |
adjugate(float[] dest,
float[] m)
Sets the dest matrix to the adjugate (i.e "classical adjoint") matrix of m) It is always defined, even when m is not invertible. |
static float |
adjugateTranspose(float[] dest,
float[] m)
Sets the dest matrix to the transpose of the adjugate (i.e "classical adjoint" matrix of m) It is always defined, even when m is not invertible. |
protected static float |
adjugateTransposeMat4f(float[] dest,
float[] m)
Sets the dest matrix to the transpose of the adjugate of the rotation/scaling 3x3 part of the 4x4 matrix m. |
static void |
convertTo3x3(float[] m)
Converts a 4 X 4 matrix, stored in a length 16(!) |
static double |
det(float[] m)
Determines the determinant of m. |
static boolean |
epsilonEquals(float[] a,
float[] b,
float epsilon)
Tests for equality of matrix components within epsilon. |
static boolean |
epsilonEquals(float[] a,
int aIndex,
float[] b,
int bIndex,
float epsilon)
Tests for equality of matrix components within epsilon. |
static boolean |
equals(float[] a,
float[] b)
Tests for equality of matrix components. |
static float[] |
from4x4(float[] m4x4)
Allocates a new 3 X 3 matrix, containing a copy of the upper-left 3 X 3 matrix from an 4 X 4 matrix. |
static void |
getColumn(float[] m,
int j,
float[] col)
Copies a matrix column with index j from a 3X3 matrix m. |
static void |
getDiagonal(float[] matrix3f,
float[] vec3f)
Returns the diagonal in a Vec3f array |
static float |
getElement(float[] m,
int i,
int j)
Gets the float value of matrix element m(i,j), form a row-major order 3X3 matrix m. |
static float[] |
getIdentity()
Allocates a new 3X3 matrix, initialized to the identity matrix. |
static float[] |
getMat3f()
Returns a new float[9] array with zero components |
static void |
getRow(float[] m,
int i,
float[] row)
Copies a matrix row with index i from a 3X3 matrix m. |
static float[] |
getScalingMatrix(float[] s)
Allocates a new 3X3 scaling matrix, with scaling factors specified in a length 3 float array. |
static Mat3f.ScalingType |
getScalingType(float[] m)
Determines the scaling type of a matrix The type is SKEW if there are any non-zero off-diagonal elements. |
static Mat3f.ScalingType |
getScalingTypeVec3f(float[] scaleVec)
Deprecated. Restored for compatibility with Herwin's demos |
static float[] |
getSkewMatrix(float[] matrix,
float angle,
float[] rvec,
float[] tvec)
Allocates a new skew/shear matrix, specified in Renderman style, by means of a translation vector tvec, a rotation vector rvec, and a rotation angle. |
static float[] |
getSkewMatrix(float angle,
float[] rvec,
float[] tvec)
Like getSkewMatrix with null matrix argument |
static float |
invert(float[] dest,
float[] m)
Inverts matrix m and returns the determinant of m. |
static float |
invertTranspose(float[] dest,
float[] m)
Sets dest to the transpose of the inverted m matrix, and returns the determinant of m. |
static float |
invertTransposeMat4f(float[] dest3x3,
float[] m4x4)
Sets dest to the 3x3 matrix that is the inverse-transpose of the rotation/scaling part of the 4x4 matrix m |
static boolean |
isDiagonal(float[] m,
float epsilon)
Determines whether some 3 X 3 matrix is in diagonal form. |
static boolean |
isIdentity(float[] m)
Checks whether some matrix is actually the identity matrix. |
static boolean |
isOrthogonal(float[] m,
float epsilon)
Checks for orthogonality of m. |
static boolean |
isSymmetric(float[] m,
float epsilon)
Determines whether some 3 X 3 matrix is symmetric. |
static boolean |
isZero(float[] m)
Checks whether some matrix is actually the zero matrix. |
static void |
mul(float[] dest,
float[] m)
Multiplies dest with m and stores the result in dest: dest = dest * m |
static void |
mul(float[] dest,
float[] a,
float[] b)
Multiplies a with b and stores the result in dest. |
static void |
mul(float[] dest,
int destIndex,
float[] m,
int mIndex)
Multiplies dest with m and stores the result in dest: dest = dest * m |
static void |
mul(float[] dest,
int dIndex,
float[] a,
int aIndex,
float[] b,
int bIndex)
Multiplies a with b and stores the result in dest. |
static void |
mulTransposeRight(float[] dest,
float[] a,
float[] b)
Multiplies a with b^T and stores the result in dest. |
static void |
mulTransposeRight(float[] dest,
int dstIndex,
float[] a,
int aIndex,
float[] b,
int bIndex)
Multiplies a with b^T and stores the result in dest. |
static float |
norm1(float[] m)
Return the norm_1 of matrix m: the sum of the absolute values of all matrix elements. |
static float |
norm2(float[] m)
Return the norm-2 of matrix m: the square root of the sum of the squares of all elements. |
static float |
normInf(float[] m)
Return the max norm of matrix m: the max absolute value of the matrix elements. |
static double |
polarDecompose(float[] m,
float[] q,
float[] s)
Performs a polar decomposition of matrix M into factor Q and S: M = Q S Q is orthogonal, S is symmetric. |
static Mat3f.ScalingType |
polarDecompose(float[] m,
float[] q,
float[] s,
float epsilon)
Deprecated. Restored for compatibility with Herwin's demos, do not remove |
static void |
scale(float[] m,
double s)
Scales the matrix m by means of factor s. |
static void |
scale(float[] m,
float s)
Scales the matrix m by means of factor s. |
static void |
scale(float[] dst,
float[] src,
float s)
Scales the matrix src by means of factor s, stores result in dst. |
static void |
scale(float[] m,
int iIndex,
double s)
Scales the matrix m by means of factor s. |
static void |
scale(float[] m,
int iIndex,
float s)
Scales the matrix m by means of factor s. |
static void |
scale(float[] dst,
int dstIndex,
float[] src,
int srcIndex,
float s)
Scales the matrix src by means of factor s, stores result in dst. |
static void |
set(float[] dst,
float[] src)
Copies a 3X3 matrix src into matrix dst |
static void |
set(float[] dst,
float src00,
float src01,
float src02,
float src10,
float src11,
float src12,
float src20,
float src21,
float src22)
Sets the matrix from 9 float values; |
static void |
set(float[] dst,
int dstIndex,
float[] src,
int srcIndex)
Copies a 3X3 matrix src into matrix dst |
static void |
set(float[] dst,
int dIndex,
float src00,
float src01,
float src02,
float src10,
float src11,
float src12,
float src20,
float src21,
float src22)
Sets the matrix from 9 float values; |
static void |
setDiagonal(float[] matrix3f,
float[] vec3f)
Sets the diagonal elements in a 3 X 3 matrix from a Vec3f array. |
static void |
setElement(float[] m,
int i,
int j,
float value)
Sets the element m(i,j) from a (row-major) 3X3 matrix m to a specified float value. |
static void |
setFromAxisAngleScale(float[] m,
float[] aa,
float scale)
Sets a 3X3 matrix from a axis angle aa and scale factor. |
static void |
setFromAxisAngleScale(float[] m,
float[] axis,
float angle,
float scale)
Sets a 3X3 matrix from an axis (float[3]), angle and scale factor. |
static void |
setFromQuatScale(float[] m,
float[] q,
float s)
Sets a 3X3 matrix from a unit quaternion and scale factor. |
static void |
setFromQuatScale(float[] m,
int mIndex,
float[] q,
int qIndex,
float s)
Sets a 3X3 matrix from a unit quaternion and scale factor. |
static void |
setIdentity(float[] m)
Resets the 3X3 matrix to the identity matrix. |
static void |
setIdentity(float[] m,
int index)
Resets the 3X3 matrix to the identity matrix. |
static void |
setRow(float[] m,
int i,
float[] row)
Sets row i in the 3X3 matrix m. |
static void |
setXRot(float[] m,
float angle)
Sets m to the rotation matrix of a rotation of angle around the x-axis. |
static void |
setXRotDegrees(float[] m,
float angle)
Sets m to the rotation matrix of a rotation of angle degrees around the x-axis. |
static void |
setYRot(float[] m,
float angle)
Sets m to the rotation matrix of a rotation of angle around the y-axis. |
static void |
setYRotDegrees(float[] m,
float angle)
Sets m to the rotation matrix of a rotation of angle degrees around the y-axis. |
static void |
setZero(float[] m)
Resets the 3X3 matrix to zero |
static void |
setZRot(float[] m,
float angle)
Sets m to the rotation matrix of a rotation of angle around the z-axis. |
static void |
setZRotDegrees(float[] m,
float angle)
Sets m to the rotation matrix of a rotation of angle degrees around the z-axis. |
static void |
skew(float[] m,
float[] v)
Sets the skew matrix 0 -vz vy vz 0 -vx -vy vx 0 from a vector |
static void |
skew(float[] m,
float vx,
float vy,
float vz)
Sets the skew matrix 0 -vz vy vz 0 -vx -vy vx 0 from a vector |
static void |
skew(float[] m,
int mIndex,
float[] v,
int vIndex)
Sets the skew matrix 0 -vz vy vz 0 -vx -vy vx 0 from a vector |
static void |
smooth(float[] m,
float eps)
Matrix elements close to 0.0, 1.0, or -1.0 are rounded towards those values, provided the difference is less than eps |
static void |
sub(float[] dest,
float[] a)
dest -= a |
static void |
sub(float[] dest,
float[] a,
float[] b)
dest = a-b |
static void |
sub(float[] dest,
int destIndex,
float[] a,
int aIndex)
dest -= b |
static void |
sub(float[] dest,
int destIndex,
float[] a,
int aIndex,
float[] b,
int bIndex)
dest = a-b |
static String |
toString(float[] m)
|
static String |
toString(float[] m,
int mIndex)
|
static String |
toString(float[] m,
int tab,
int fieldwidth,
int precision)
Produces a String representation of Mat4f matrix m, taking into account tab spaces at the beginning of every newline. |
static String |
toString(float[] m,
int tab,
String fmt)
Produces a String representation of Mat4f matrix m, taking into account tab spaces at the beginning of every newline. |
static String |
toStringTabbed(float[] m,
int tab)
Produces a String representation of Mat3f matrix m, taking into account tab spaces at the beginning of every newline. |
static String |
toStringTabbed(float[] m,
int mIndex,
int tab)
Produces a String representation of Mat3f matrix m, taking into account tab spaces at the beginning of every newline. |
static void |
transform(float[] m,
float[] dst)
Transforms a Vec3 vector dst, and puts the result back in vector dst. |
static void |
transform(float[] m,
float[] dest,
float[] src)
Transforms a Vec3 vector src, and puts the result in vector dest. |
static void |
transform(float[] m,
float[] dest,
int destIndex,
float srcx,
float srcy,
float srcz)
Transforms a 3 float src, and puts the result in vector dest. |
static void |
transform(float[] m,
int mIndex,
float[] dst,
int dstIndex)
Transforms a Vec3 vector dst, and puts the result back in vector dst. |
static void |
transform(float[] m,
int mIndex,
float[] dest,
int destIndex,
float[] src,
int srcIndex)
Transforms a Vec3 vector src, and puts the result in vector dest. |
static void |
transform(float[] m,
int mIndex,
float[] dest,
int destIndex,
float srcx,
float srcy,
float srcz)
Transforms a 3 float src, and puts the result in vector dest. |
static void |
transformTranspose(float[] m,
float[] dst,
float[] src)
Transforms a Vec3 with the transpose of matrix m |
static void |
transformTranspose(float[] m,
int mIndex,
float[] dst,
int dstIndex,
float[] src,
int srcIndex)
Transforms a Vec3 with the matrix transpose |
static void |
transformVec3f(float[] m,
float[] dest)
Transforms a Vec3 vector dest in place |
static void |
transformVec3f(float[] m,
float[] dst,
int destIndex)
Transforms a Vec3 vector dest in place |
static void |
transformVec3f(float[] m,
int mIndex,
float[] dest,
int dIndex)
Transforms a Vec3 vector dest in place |
static void |
transpose(float[] m)
Transposes matrix m. |
static void |
transpose(float[] dest,
float[] m)
Sets matrix dest to the transpose of matrix m. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ROW_SIZE
public static final int COL_SIZE
public static final int MAT3F_SIZE
public static final double DEGREEPERRAD
public static final int M00
public static final int M01
public static final int M02
public static final int M10
public static final int M11
public static final int M12
public static final int M20
public static final int M21
public static final int M22
private static final float NORMALIZE_THRESHOLD
public static final float TOL
private static final float POLARDECOMPOSESMOOTHFACTOR
private static final float MINIMAL_SKEW_ANGLE
| Constructor Detail |
|---|
private Mat3f()
| Method Detail |
|---|
public static float[] getMat3f()
@Deprecated public static Mat3f.ScalingType getScalingTypeVec3f(float[] scaleVec)
public static float[] getScalingMatrix(float[] s)
public static void scale(float[] m,
float s)
public static void scale(float[] dst,
float[] src,
float s)
public static void scale(float[] dst,
int dstIndex,
float[] src,
int srcIndex,
float s)
public static void scale(float[] m,
int iIndex,
float s)
public static void scale(float[] m,
int iIndex,
double s)
public static void scale(float[] m,
double s)
public static void set(float[] dst,
int dstIndex,
float[] src,
int srcIndex)
public static void set(float[] dst,
float src00,
float src01,
float src02,
float src10,
float src11,
float src12,
float src20,
float src21,
float src22)
public static void set(float[] dst,
int dIndex,
float src00,
float src01,
float src02,
float src10,
float src11,
float src12,
float src20,
float src21,
float src22)
public static void set(float[] dst,
float[] src)
public static void setXRot(float[] m,
float angle)
public static void setXRotDegrees(float[] m,
float angle)
public static void setYRot(float[] m,
float angle)
public static void setYRotDegrees(float[] m,
float angle)
public static void setZRot(float[] m,
float angle)
public static void setZRotDegrees(float[] m,
float angle)
public static void setFromQuatScale(float[] m,
float[] q,
float s)
public static void setFromQuatScale(float[] m,
int mIndex,
float[] q,
int qIndex,
float s)
public static void setFromAxisAngleScale(float[] m,
float[] axis,
float angle,
float scale)
public static void setFromAxisAngleScale(float[] m,
float[] aa,
float scale)
public static void setZero(float[] m)
public static void setIdentity(float[] m)
public static void setIdentity(float[] m,
int index)
public static float[] getIdentity()
public static boolean isIdentity(float[] m)
public static boolean isZero(float[] m)
public static void setElement(float[] m,
int i,
int j,
float value)
public static float getElement(float[] m,
int i,
int j)
public static void getRow(float[] m,
int i,
float[] row)
public static void setRow(float[] m,
int i,
float[] row)
public static void getColumn(float[] m,
int j,
float[] col)
public static void mul(float[] dest,
int dIndex,
float[] a,
int aIndex,
float[] b,
int bIndex)
public static void mulTransposeRight(float[] dest,
float[] a,
float[] b)
public static void mulTransposeRight(float[] dest,
int dstIndex,
float[] a,
int aIndex,
float[] b,
int bIndex)
public static void mul(float[] dest,
float[] a,
float[] b)
public static void mul(float[] dest,
float[] m)
public static void mul(float[] dest,
int destIndex,
float[] m,
int mIndex)
public static void transform(float[] m,
int mIndex,
float[] dest,
int destIndex,
float srcx,
float srcy,
float srcz)
public static void transform(float[] m,
float[] dest,
int destIndex,
float srcx,
float srcy,
float srcz)
public static void transform(float[] m,
int mIndex,
float[] dest,
int destIndex,
float[] src,
int srcIndex)
public static void transform(float[] m,
int mIndex,
float[] dst,
int dstIndex)
public static void transform(float[] m,
float[] dest,
float[] src)
public static void transform(float[] m,
float[] dst)
public static boolean equals(float[] a,
float[] b)
public static boolean epsilonEquals(float[] a,
int aIndex,
float[] b,
int bIndex,
float epsilon)
public static boolean epsilonEquals(float[] a,
float[] b,
float epsilon)
public static void transformTranspose(float[] m,
float[] dst,
float[] src)
public static void transformTranspose(float[] m,
int mIndex,
float[] dst,
int dstIndex,
float[] src,
int srcIndex)
public static void transpose(float[] dest,
float[] m)
public static void transpose(float[] m)
public static void add(float[] dest,
float[] a)
public static void sub(float[] dest,
float[] a)
public static void add(float[] dest,
int destIndex,
float[] a,
int aIndex)
public static void sub(float[] dest,
int destIndex,
float[] a,
int aIndex)
public static void add(float[] dest,
float[] a,
float[] b)
public static void sub(float[] dest,
float[] a,
float[] b)
public static void sub(float[] dest,
int destIndex,
float[] a,
int aIndex,
float[] b,
int bIndex)
public static void add(float[] dest,
int destIndex,
float[] a,
int aIndex,
float[] b,
int bIndex)
public static double det(float[] m)
public static float adjugateTranspose(float[] dest,
float[] m)
protected static float adjugateTransposeMat4f(float[] dest,
float[] m)
public static float adjugate(float[] dest,
float[] m)
public static float invert(float[] dest,
float[] m)
public static float invertTranspose(float[] dest,
float[] m)
public static float invertTransposeMat4f(float[] dest3x3,
float[] m4x4)
public static float norm1(float[] m)
public static float norm2(float[] m)
public static float normInf(float[] m)
public static float[] from4x4(float[] m4x4)
public static void convertTo3x3(float[] m)
public static boolean isDiagonal(float[] m,
float epsilon)
public static void getDiagonal(float[] matrix3f,
float[] vec3f)
public static void setDiagonal(float[] matrix3f,
float[] vec3f)
public static boolean isSymmetric(float[] m,
float epsilon)
public static boolean isOrthogonal(float[] m,
float epsilon)
public static double polarDecompose(float[] m,
float[] q,
float[] s)
@Deprecated
public static Mat3f.ScalingType polarDecompose(float[] m,
float[] q,
float[] s,
float epsilon)
public static void smooth(float[] m,
float eps)
public static Mat3f.ScalingType getScalingType(float[] m)
public static void skew(float[] m,
float[] v)
public static void skew(float[] m,
float vx,
float vy,
float vz)
public static void skew(float[] m,
int mIndex,
float[] v,
int vIndex)
public static float[] getSkewMatrix(float angle,
float[] rvec,
float[] tvec)
public static float[] getSkewMatrix(float[] matrix,
float angle,
float[] rvec,
float[] tvec)
public static void transformVec3f(float[] m,
float[] dest)
public static void transformVec3f(float[] m,
float[] dst,
int destIndex)
public static void transformVec3f(float[] m,
int mIndex,
float[] dest,
int dIndex)
public static String toString(float[] m)
public static String toString(float[] m,
int mIndex)
public static String toString(float[] m,
int tab,
int fieldwidth,
int precision)
public static String toString(float[] m,
int tab,
String fmt)
public static String toStringTabbed(float[] m,
int tab)
m - the Mat3famount - of spaces before every line
public static String toStringTabbed(float[] m,
int mIndex,
int tab)
m - the Mat3famount - of spaces before every line
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||