Package rosequartz.math
Class Mat4
java.lang.Object
rosequartz.math.Mat4
- All Implemented Interfaces:
Serializable
Represents any 4x4 Matrix.
The matrix values are named:
[ m00 m10 m20 m30 ]
| m01 m11 m21 m31 |
| m02 m12 m22 m32 |
[ m03 m13 m23 m33 ]
- See Also:
- Serialized Form
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMat4()Creates a new Matrix4 and calls identity.Mat4(float m00, float m10, float m20, float m30, float m01, float m11, float m21, float m31, float m02, float m12, float m22, float m32, float m03, float m13, float m23, float m33)Creates a new Matrix4 and calls set with the given values.Creates a new Matrix4 with the values of the given matrix. -
Method Summary
Modifier and TypeMethodDescriptionfloatget(int column, int row)Returns the given value.getColumn(int column)Returns the given column as a vector.getRow(int row)Returns the given row as a vector.float[]Returns the values in the matrix as an array.identity()Sets the values of the matrix to these values:Multiplies this matrix with the given matrix and stores the result in this.Multiplies this matrix with the given matrix and stores the result in destMultiplies this matrix with the given matrix and stores the result in a new matrix, returning it.set(float m00, float m10, float m20, float m30, float m01, float m11, float m21, float m31, float m02, float m12, float m22, float m32, float m03, float m13, float m23, float m33)Sets the values of the matrix.set(int column, int row, float value)Sets the component in the given row and column to a given value.Sets the values of this matrix to the values of the given matrix.toString()
-
Field Details
-
m00
public float m00 -
m10
public float m10 -
m20
public float m20 -
m30
public float m30 -
m01
public float m01 -
m11
public float m11 -
m21
public float m21 -
m31
public float m31 -
m02
public float m02 -
m12
public float m12 -
m22
public float m22 -
m32
public float m32 -
m03
public float m03 -
m13
public float m13 -
m23
public float m23 -
m33
public float m33
-
-
Constructor Details
-
Mat4
public Mat4()Creates a new Matrix4 and calls identity.- See Also:
identity()
-
Mat4
Creates a new Matrix4 with the values of the given matrix.- Parameters:
mat- matrix to copy values from
-
Mat4
public Mat4(float m00, float m10, float m20, float m30, float m01, float m11, float m21, float m31, float m02, float m12, float m22, float m32, float m03, float m13, float m23, float m33)Creates a new Matrix4 and calls set with the given values.
-
-
Method Details
-
set
public Mat4 set(float m00, float m10, float m20, float m30, float m01, float m11, float m21, float m31, float m02, float m12, float m22, float m32, float m03, float m13, float m23, float m33)Sets the values of the matrix.- Parameters:
m00- value (see class for layout)m01- value (see class for layout)m02- value (see class for layout)m03- value (see class for layout)m10- value (see class for layout)m11- value (see class for layout)m12- value (see class for layout)m13- value (see class for layout)m20- value (see class for layout)m21- value (see class for layout)m22- value (see class for layout)m23- value (see class for layout)m30- value (see class for layout)m31- value (see class for layout)m32- value (see class for layout)m33- value (see class for layout)- Returns:
- this
- See Also:
Mat4
-
set
Sets the values of this matrix to the values of the given matrix.- Parameters:
mat- matrix to copy values from- Returns:
- this
-
set
Sets the component in the given row and column to a given value.- Parameters:
column- column of component (0, 1, 2 or 3)row- row of component (0, 1, 2 or 3)value- value to set- Returns:
- this
-
getColumn
Returns the given column as a vector.- Parameters:
column- index of column (0, 1, 2 or 3)- Returns:
- column as vector
-
getRow
Returns the given row as a vector.- Parameters:
row- index of row (0, 1, 2 or 3)- Returns:
- row as vector
-
get
public float get(int column, int row)Returns the given value.- Parameters:
column- index of column (0, 1, 2 or 3)row- index of row (0, 1, 2 or 3)- Returns:
- value
-
identity
Sets the values of the matrix to these values:[ 1 0 0 0 ] | 0 1 0 0 | | 0 0 1 0 | [ 0 0 0 1 ]- Returns:
- this
-
mul
Multiplies this matrix with the given matrix and stores the result in this.- Parameters:
mat- matrix to multiply with this one- Returns:
- result in this
-
mul
Multiplies this matrix with the given matrix and stores the result in dest- Parameters:
mat- matrix to multiply with this onedest- matrix to store result in- Returns:
- this
-
mulN
Multiplies this matrix with the given matrix and stores the result in a new matrix, returning it.- Parameters:
mat- matrix to multiply with this one- Returns:
- new matrix holding the result
-
getValues
public float[] getValues()Returns the values in the matrix as an array.- Returns:
- values of matrix as array
-
toString
-