|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.cult3d.math.Matrix4x4
This class represents a 4x4 matrix and define a few matrix operations.
Constructor Summary | |
Matrix4x4()
Constructs and initializes a Matri4x4 to all zeros. |
|
Matrix4x4(float[] array)
Constructor that creates a new matrix4x4 from an array of floats with length of 16. |
|
Matrix4x4(Matrix4x4 matrix)
Constructs a Matrix4x4 with the same values as the given parameter. |
Method Summary | |
void |
add(Matrix4x4 matrix)
Adds the matrix given as parameter to this matrix, element by element. |
boolean |
equals(java.lang.Object obj)
Returns true if this matrix and the Object given as argument are equal. |
java.lang.String |
getInfo()
This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations and versions of Cult3D. |
float[] |
getMatrix()
Returns a float array containing the elements of this matrix row by row. |
float |
getValue(int row,
int col)
Gets the value of the element at a specific row and column. |
void |
identity()
Sets this Matrix to the identity Matrix. |
void |
mult(float f)
Multiplies each element of this matrix with the value given as parameter. |
void |
setMatrix(float[] array)
Sets the values of this matrix using the values supplied by the given float array. |
void |
setMatrix(Matrix4x4 matrix)
Copies the values from the source matrix, given as argument, to this matrix. |
void |
setValue(int row,
int col,
float value)
Sets the value of the element at a specific row and column. |
void |
sub(Matrix4x4 matrix)
Subtracts the matrix given as parameter from this matrix, element by element. |
java.lang.String |
toString()
Returns a string representation of the values of this object. |
void |
transpose()
Transposes this matrix. |
Methods inherited from class java.lang.Object |
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public Matrix4x4()
public Matrix4x4(Matrix4x4 matrix)
matrix
- The source matrixpublic Matrix4x4(float[] array)
The array elements will be placed in the matrix as follows:
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
array
- A float array of length 16 that contains the values of the matrix.Method Detail |
public void setMatrix(Matrix4x4 matrix)
matrix
- The source matrixpublic void setMatrix(float[] array)
The array elements will be placed in the matrix as follows:
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
array
- The source array with length 16public float[] getMatrix()
public void setValue(int row, int col, float value)
row
- the rowcol
- the columnvalue
- the new valuepublic float getValue(int row, int col)
row
- the rowcol
- the columnpublic void add(Matrix4x4 matrix)
matrix
- the matrix to addpublic void sub(Matrix4x4 matrix)
matrix
- The matrix to subtractpublic void mult(float f)
f
- The value to multiplie withpublic void transpose()
public void identity()
public boolean equals(java.lang.Object obj)
public java.lang.String getInfo()
public java.lang.String toString()
Returns a string representation of the values of this object.
The string contains the name of this class, and the values of the matrix.
This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations and versions of Cult3D.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |