MaxstARSDK
|
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 |
Static Public Attributes | |
static final int[] | matIndCol9_3x3 = { 0, 1, 2, 3, 4, 5, 6, 7, 8 } |
static final int[] | matIndCol16_3x3 = { 0, 1, 2, 4, 5, 6, 8, 9, 10 } |
static final int[] | matIndRow9_3x3 = { 0, 3, 6, 1, 4, 7, 3, 5, 8 } |
static final int[] | matIndRow16_3x3 = { 0, 4, 8, 1, 5, 9, 2, 6, 10 } |
static final int[] | matIndCol16_4x4 = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } |
static final int[] | matIndRow16_4x4 = { 0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15 } |
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.
com.maxst.ar.MatrixF4x4.MatrixF4x4 | ( | ) |
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.
float [] com.maxst.ar.MatrixF4x4.getMatrix | ( | ) |
Gets the matrix.
boolean com.maxst.ar.MatrixF4x4.isColumnMajor | ( | ) |
Find out if the stored matrix is column major
void com.maxst.ar.MatrixF4x4.multiplyMatrix | ( | float[] | input, |
int | inputOffset, | ||
float[] | output, | ||
int | outputOffset | ||
) |
void com.maxst.ar.MatrixF4x4.multiplyMatrix4x4ByMatrix | ( | MatrixF4x4 | matrixf | ) |
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]; } }
void com.maxst.ar.MatrixF4x4.multiplyVector3fByMatrix | ( | Vector3f | vector | ) |
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. |
void com.maxst.ar.MatrixF4x4.multiplyVector4fByMatrix | ( | Vector4f | vector | ) |
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. |
void com.maxst.ar.MatrixF4x4.set | ( | MatrixF4x4 | source | ) |
void com.maxst.ar.MatrixF4x4.setColumnMajor | ( | boolean | colMajor | ) |
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 |
void com.maxst.ar.MatrixF4x4.setMatrix | ( | float[] | matrix | ) |
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 |
void com.maxst.ar.MatrixF4x4.setW0 | ( | float | value | ) |
void com.maxst.ar.MatrixF4x4.setW1 | ( | float | value | ) |
void com.maxst.ar.MatrixF4x4.setW2 | ( | float | value | ) |
void com.maxst.ar.MatrixF4x4.setW3 | ( | float | value | ) |
void com.maxst.ar.MatrixF4x4.setX0 | ( | float | value | ) |
void com.maxst.ar.MatrixF4x4.setX1 | ( | float | value | ) |
void com.maxst.ar.MatrixF4x4.setX2 | ( | float | value | ) |
void com.maxst.ar.MatrixF4x4.setX3 | ( | float | value | ) |
void com.maxst.ar.MatrixF4x4.setY0 | ( | float | value | ) |
void com.maxst.ar.MatrixF4x4.setY1 | ( | float | value | ) |
void com.maxst.ar.MatrixF4x4.setY2 | ( | float | value | ) |
void com.maxst.ar.MatrixF4x4.setY3 | ( | float | value | ) |
void com.maxst.ar.MatrixF4x4.setZ0 | ( | float | value | ) |
void com.maxst.ar.MatrixF4x4.setZ1 | ( | float | value | ) |
void com.maxst.ar.MatrixF4x4.setZ2 | ( | float | value | ) |
void com.maxst.ar.MatrixF4x4.setZ3 | ( | float | value | ) |
int com.maxst.ar.MatrixF4x4.size | ( | ) |
void com.maxst.ar.MatrixF4x4.transpose | ( | ) |
This will rearrange the internal structure of the matrix. Be careful though as this is an expensive operation.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
float [] com.maxst.ar.MatrixF4x4.matrix |
The matrix.