|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jme.math.Matrix4f
Matrix defines and maintains a 4x4 matrix in row major order.
This matrix is intended for use in a translation and rotational capacity.
It provides convinience methods for creating the matrix from a multitude
of sources.
| Field Summary | |
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
|
| Constructor Summary | |
Matrix4f()
Constructor instantiates a new Matrix that is set to the
identity matrix. |
|
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 a matrix with the given values. |
|
Matrix4f(Matrix4f mat)
Constructor instantiates a new Matrix that is set to the
provided matrix. |
|
| Method Summary | |
void |
add(Matrix4f mat)
add adds the values of a parameter matrix to this matrix. |
Matrix4f |
adjoint()
Returns a new matrix representing the adjoint of this matrix. |
Matrix4f |
adjoint(Matrix4f store)
Places the adjoint of this matrix in store (creates store if null.) |
void |
angleRotation(Vector3f angles)
angleRotation sets this matrix to that of a rotation about
three axes (x, y, z). |
void |
copy(Matrix4f matrix)
copy transfers the contents of a given matrix to this
matrix. |
float |
determinant()
determinant generates the determinate of this matrix. |
java.nio.FloatBuffer |
fillFloatBuffer(java.nio.FloatBuffer fb)
fillFloatBuffer fills a FloatBuffer object with
the matrix data. |
void |
fromAngleAxis(float angle,
Vector3f axis)
fromAngleAxis sets this matrix4f to the values specified
by an angle and an axis of rotation. |
void |
fromAngleNormalAxis(float angle,
Vector3f axis)
fromAngleNormalAxis sets this matrix4f to the values
specified by an angle and a normalized axis of rotation. |
void |
get(float[] matrix)
get retrieves the values of this object into
a float array in row-major order. |
void |
get(float[] matrix,
boolean rowMajor)
set retrieves the values of this object into
a float array. |
float |
get(int i,
int j)
get retrieves a value from the matrix at the given
position. |
float[] |
getColumn(int i)
getColumn returns one of three columns specified by the
parameter. |
float[] |
getColumn(int i,
float[] store)
getColumn returns one of three columns specified by the
parameter. |
Vector3f |
inverseRotate(Vector3f v)
inverseRotate uses the rotational part of the matrix to
rotate a vector in the opposite direction. |
void |
inverseRotateVect(float[] vec)
inverseRotateVect rotates a given Vector3f by the rotation
part of this matrix. |
void |
inverseTranslateVect(float[] Vector3f)
inverseTranslateVect translates a given Vector3f by the
translation part of this matrix. |
Matrix4f |
invert()
Inverts this matrix as a new Matrix3f. |
Matrix4f |
invert(Matrix4f store)
Inverts this matrix and stores it in the given store. |
Matrix4f |
invertLocal()
Inverts this matrix locally. |
void |
loadIdentity()
loadIdentity sets this matrix to the identity matrix,
namely all zeros with ones along the diagonal. |
float[] |
mult(float[] vec4f)
mult multiplies an array of 4 floats against this rotation
matrix. |
Matrix4f |
mult(Matrix4f in2)
mult multiplies this matrix with another matrix. |
Matrix4f |
mult(Matrix4f in2,
Matrix4f store)
mult multiplies this matrix with another matrix. |
Vector3f |
mult(Vector3f vec)
mult multiplies a vector about a rotation matrix. |
Vector3f |
mult(Vector3f vec,
Vector3f store)
mult multiplies a vector about a rotation matrix. |
void |
multLocal(float scalar)
mult multiplies this matrix by a scalar. |
Matrix4f |
multLocal(Matrix4f in2)
mult multiplies this matrix with another matrix. |
void |
set(float[] matrix)
set sets the values of this matrix from an array of
values assuming that the data is rowMajor order; |
void |
set(float[][] matrix)
set sets the values of this matrix from an array of
values. |
void |
set(float[] matrix,
boolean rowMajor)
set sets the values of this matrix from an array of
values; |
void |
set(int i,
int j,
float value)
set places a given value into the matrix at the given
position. |
void |
set(Quaternion quaternion)
set defines the values of the matrix based on a supplied
Quaternion. |
void |
setColumn(int i,
float[] column)
setColumn sets a particular column of this matrix to that
represented by the provided vector. |
void |
setInverseRotationDegrees(float[] angles)
setInverseRotationDegrees builds an inverted rotation from
Euler angles that are in degrees. |
void |
setInverseRotationRadians(float[] angles)
setInverseRotationRadians builds an inverted rotation from
Euler angles that are in radians. |
void |
setInverseTranslation(float[] translation)
setInverseTranslation will set the matrix's inverse
translation values. |
void |
setRotationQuaternion(Quaternion quat)
setRotationQuaternion builds a rotation from a
Quaternion. |
void |
setTranslation(float[] translation)
setTranslation will set the matrix's translation values. |
java.nio.FloatBuffer |
toFloatBuffer()
toFloatBuffer returns a FloatBuffer object that contains
the matrix data. |
java.lang.String |
toString()
toString returns the string representation of this object. |
Matrix4f |
transpose()
transpose locally transposes this Matrix. |
Matrix4f |
zero()
Sets all of the values in this matrix to zero. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public float m00
public float m01
public float m02
public float m03
public float m10
public float m11
public float m12
public float m13
public float m20
public float m21
public float m22
public float m23
public float m30
public float m31
public float m32
public float m33
| Constructor Detail |
public Matrix4f()
Matrix that is set to the
identity matrix.
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)
public Matrix4f(Matrix4f mat)
Matrix that is set to the
provided matrix. This constructor copies a given Matrix. If the provided
matrix is null, the constructor sets the matrix to the identity.
mat - the matrix to copy.| Method Detail |
public void copy(Matrix4f matrix)
copy transfers the contents of a given matrix to this
matrix. If a null matrix is supplied, this matrix is set to the identity
matrix.
matrix - the matrix to copy.public void get(float[] matrix)
get retrieves the values of this object into
a float array in row-major order.
matrix - the matrix to set the values into.
public void get(float[] matrix,
boolean rowMajor)
set retrieves the values of this object into
a float array.
matrix - the matrix to set the values into.rowMajor - whether the outgoing data is in row or column major order.
public float get(int i,
int j)
get retrieves a value from the matrix at the given
position. If the position is invalid a JmeException is
thrown.
i - the row index.j - the colum index.
public float[] getColumn(int i)
getColumn returns one of three columns specified by the
parameter. This column is returned as a float array of length 4.
i - the column to retrieve. Must be between 0 and 3.
public float[] getColumn(int i,
float[] store)
getColumn returns one of three columns specified by the
parameter. This column is returned as a float[4].
i - the column to retrieve. Must be between 0 and 3.store - the float array to store the result in. if null, a new one
is created.
public void setColumn(int i,
float[] column)
setColumn sets a particular column of this matrix to that
represented by the provided vector.
i - the column to set.column - the data to set.
public void set(int i,
int j,
float value)
set places a given value into the matrix at the given
position. If the position is invalid a JmeException is
thrown.
i - the row index.j - the colum index.value - the value for (i, j).public void set(float[][] matrix)
set sets the values of this matrix from an array of
values.
matrix - the matrix to set the value to.
JmeException - if the array is not of size 16.public void set(float[] matrix)
set sets the values of this matrix from an array of
values assuming that the data is rowMajor order;
matrix - the matrix to set the value to.
public void set(float[] matrix,
boolean rowMajor)
set sets the values of this matrix from an array of
values;
matrix - the matrix to set the value to.rowMajor - whether the incoming data is in row or column major order.public void set(Quaternion quaternion)
set defines the values of the matrix based on a supplied
Quaternion. It should be noted that all previous values
will be overridden.
public Matrix4f transpose()
transpose locally transposes this Matrix.
public java.nio.FloatBuffer toFloatBuffer()
toFloatBuffer returns a FloatBuffer object that contains
the matrix data.
public java.nio.FloatBuffer fillFloatBuffer(java.nio.FloatBuffer fb)
fillFloatBuffer fills a FloatBuffer object with
the matrix data.
fb - the buffer to fill, must be correct size
public void loadIdentity()
loadIdentity sets this matrix to the identity matrix,
namely all zeros with ones along the diagonal.
public void fromAngleAxis(float angle,
Vector3f axis)
fromAngleAxis sets this matrix4f to the values specified
by an angle and an axis of rotation. This method creates an object, so
use fromAngleNormalAxis if your axis is already normalized.
angle - the angle to rotate (in radians).axis - the axis of rotation.
public void fromAngleNormalAxis(float angle,
Vector3f axis)
fromAngleNormalAxis sets this matrix4f to the values
specified by an angle and a normalized axis of rotation.
angle - the angle to rotate (in radians).axis - the axis of rotation (already normalized).public void multLocal(float scalar)
mult multiplies this matrix by a scalar.
scalar - the scalar to multiply this matrix by.public Matrix4f mult(Matrix4f in2)
mult multiplies this matrix with another matrix. The
result matrix will then be returned. This matrix will be on the left hand
side, while the parameter matrix will be on the right.
in2 - the matrix to multiply this matrix by.
public Matrix4f mult(Matrix4f in2,
Matrix4f store)
mult multiplies this matrix with another matrix. The
result matrix will then be returned. This matrix will be on the left hand
side, while the parameter matrix will be on the right.
in2 - the matrix to multiply this matrix by.store - where to store the result.
public Matrix4f multLocal(Matrix4f in2)
mult multiplies this matrix with another matrix. The
results are stored internally and a handle to this matrix will
then be returned. This matrix will be on the left hand
side, while the parameter matrix will be on the right.
in2 - the matrix to multiply this matrix by.
public Vector3f mult(Vector3f vec)
mult multiplies a vector about a rotation matrix. The
resulting vector is returned as a new Vector3f.
vec - vec to multiply against.
public Vector3f mult(Vector3f vec,
Vector3f store)
mult multiplies a vector about a rotation matrix. The
resulting vector is returned.
vec - vec to multiply against.store - a vector to store the result in. created if null is passed.
public float[] mult(float[] vec4f)
mult multiplies an array of 4 floats against this rotation
matrix. The results are stored directly in the array.
vec4f - float array (size 4) to multiply against the matrix.
public Matrix4f invert()
public Matrix4f invert(Matrix4f store)
public Matrix4f invertLocal()
public Matrix4f adjoint()
public Matrix4f adjoint(Matrix4f store)
store - The matrix to store the result in. If null, a new matrix is created.
public float determinant()
determinant generates the determinate of this matrix.
public Matrix4f zero()
public void add(Matrix4f mat)
add adds the values of a parameter matrix to this matrix.
mat - the matrix to add to this.public void setTranslation(float[] translation)
setTranslation will set the matrix's translation values.
translation - the new values for the translation.
MonkeyRuntimeException - if translation is not size 3.public void setInverseTranslation(float[] translation)
setInverseTranslation will set the matrix's inverse
translation values.
translation - the new values for the inverse translation.
MonkeyRuntimeException - if translation is not size 3.public void angleRotation(Vector3f angles)
angleRotation sets this matrix to that of a rotation about
three axes (x, y, z). Where each axis has a specified rotation in
degrees. These rotations are expressed in a single Vector3f
object.
angles - the angles to rotate.public void setRotationQuaternion(Quaternion quat)
setRotationQuaternion builds a rotation from a
Quaternion.
quat - the quaternion to build the rotation from.
MonkeyRuntimeException - if quat is null.public void setInverseRotationRadians(float[] angles)
setInverseRotationRadians builds an inverted rotation from
Euler angles that are in radians.
angles - the Euler angles in radians.
JmeException - if angles is not size 3.public void setInverseRotationDegrees(float[] angles)
setInverseRotationDegrees builds an inverted rotation from
Euler angles that are in degrees.
angles - the Euler angles in degrees.
JmeException - if angles is not size 3.public void inverseTranslateVect(float[] Vector3f)
inverseTranslateVect translates a given Vector3f by the
translation part of this matrix.
Vector3f - the Vector3f to be translated.
JmeException - if the size of the Vector3f is not 3.public void inverseRotateVect(float[] vec)
inverseRotateVect rotates a given Vector3f by the rotation
part of this matrix.
JmeException - if the size of the Vector3f is not 3.public Vector3f inverseRotate(Vector3f v)
inverseRotate uses the rotational part of the matrix to
rotate a vector in the opposite direction.
v - the vector to rotate.
public java.lang.String toString()
toString returns the string representation of this object.
It is in a format of a 4x4 matrix. For example, an identity matrix would
be represented by the following string. com.jme.math.Matrix3f
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||