|
Maxst AR SDK 4.0.0
4.0.0
|
Public Member Functions | |
| MatrixF4x4 () | |
| float [] | getMatrix () |
| int | size () |
| void | setMatrix (float[] matrix) |
| void | set (MatrixF4x4 source) |
| void | setColumnMajor (boolean colMajor) |
| boolean | isColumnMajor () |
| void | multiplyVector4fByMatrix (Vector4f vector) |
| void | multiplyVector3fByMatrix (Vector3f vector) |
| void | multiplyMatrix4x4ByMatrix (MatrixF4x4 matrixf) |
| void | multiplyMatrix (float[] input, int inputOffset, float[] output, int outputOffset) |
| void | transpose () |
| void | setX0 (float value) |
| void | setX1 (float value) |
| void | setX2 (float value) |
| void | setY0 (float value) |
| void | setY1 (float value) |
| void | setY2 (float value) |
| void | setZ0 (float value) |
| void | setZ1 (float value) |
| void | setZ2 (float value) |
| void | setX3 (float value) |
| void | setY3 (float value) |
| void | setZ3 (float value) |
| void | setW0 (float value) |
| void | setW1 (float value) |
| void | setW2 (float value) |
| void | setW3 (float value) |
Public Attributes | |
| float [] | matrix |
The Class MatrixF4x4.
Internal the matrix is structured as
[ x0 , y0 , z0 , w0 ] [ x1 , y1 , z1 , w1 ] [ x2 , y2 , z2 , w2 ] [ x3 , y3 , z3 , w3 ]
it is recommend that when setting the matrix values individually that you use the set{x,#} methods, where 'x' is either x, y, z or w and # is either 0, 1, 2 or 3, setY1 for example. The reason you should use these functions is because it will map directly to that part of the matrix regardless of whether or not the internal matrix is column major or not. If the matrix is either or length 9 or 16 it will be able to determine if it can set the value or not. If the matrix is of size 9 but you set say w2, the value will not be set and the set method will return without any error.
|
inline |
Instantiates a new matrixf4x4. The Matrix is assumed to be Column major, however you can change this by using the setColumnMajor function to false and it will operate like a row major matrix.
|
inline |
Gets the matrix.
|
inline |
Find out if the stored matrix is column major
|
inline |
Multiply matrix4x4 by matrix.
| matrixf | the matrixf |
for(int i = 0; i < 4; i++){ for(int j = 0; j < 4; j++){
int k = i * 4; bufferMatrix[0 + j] += this.matrix[k + j] * matrix[0 * 4 + i]; bufferMatrix[1 * 4 + j] += this.matrix[k + j] * matrix[1 * 4 + i]; bufferMatrix[2 * 4 + j] += this.matrix[k + j] * matrix[2 * 4 + i]; bufferMatrix[3 * 4 + j] += this.matrix[k + j] * matrix[3 * 4 + i]; } }
|
inline |
Multiply the given vector by this matrix. This should only be used if the matrix is of size 9 (use the matrix.size() method).
| vector | A vector of length 3. |
|
inline |
Multiply the given vector by this matrix. This should only be used if the matrix is of size 16 (use the matrix.size() method).
| vector | A vector of length 4. |
|
inline |
Set whether the internal data is col major by passing true, or false for a row major matrix. The matrix is column major by default.
| colMajor |
|
inline |
Sets the matrix from a float[16] array. If the matrix you set isn't 16 long then the matrix will be set as invalid.
| matrix | the new matrix |
|
inline |
This will rearrange the internal structure of the matrix. Be careful though as this is an expensive operation.
| float [] com.maxst.ar.MatrixF4x4.matrix |
The matrix.
1.8.14