Ocular Engine
|
A 3x3 column-major float matrix. More...
#include <Matrix3x3.hpp>
Public Member Functions | |
Matrix3x3 (float x0, float y0, float z0, float x1, float y1, float z1, float x2, float y2, float z2) | |
Matrix3x3 (float const *values) | |
Matrix3x3 (Vector3< float > const &col0, Vector3< float > const &col1, Vector3< float > const &col2) | |
Matrix3x3 (Quaternion const &quat) | |
Matrix3x3 (Euler const &euler) | |
Matrix3x3 (Vector3< float > const &euler) | |
Matrix3x3 (Matrix3x3_Internal const &data) | |
Matrix3x3 (Matrix3x3 const &other) | |
Matrix3x3 () | |
float | operator[] (uint32_t index) |
Matrix3x3 & | operator= (Matrix3x3 const &rhs) |
Matrix3x3 & | operator+= (Matrix3x3 const &rhs) |
Matrix3x3 & | operator-= (Matrix3x3 const &rhs) |
Matrix3x3 & | operator*= (Matrix3x3 const &rhs) |
Matrix3x3 & | operator*= (Vector3< float > const &rhs) |
Matrix3x3 & | operator*= (float rhs) |
void | setElement (uint32_t index, float value) |
float | getElement (uint32_t index) const |
void | setRow (uint32_t index, Vector3< float > const &row) |
void | getRow (uint32_t index, Vector3< float > &row) const |
Vector3< float > | getRow (uint32_t index) const |
void | setCol (uint32_t index, Vector3< float > const &col) |
void | getCol (uint32_t index, Vector3< float > &col) const |
Vector3< float > | getCol (uint32_t index) const |
void | setData (float const *data) |
void | getData (float *data) const |
void | invert () |
Matrix3x3 | getInverse () const |
float | getDeterminant () const |
Matrix3x3 | getTranspose () const |
Matrix3x3_Internal * | getInternal () const |
A 3x3 column-major float matrix.
x.x y.x z.x x.y y.y z.y x.z y.z z.z
00 10 20 01 11 21 02 12 22
00 03 06 01 04 07 02 05 08
Ocular::Math::Matrix3x3::Matrix3x3 | ( | float | x0, |
float | y0, | ||
float | z0, | ||
float | x1, | ||
float | y1, | ||
float | z1, | ||
float | x2, | ||
float | y2, | ||
float | z2 | ||
) |
Creates a new 3x3 column-major matrix.
[in] | x0 | First element of the x-rotation column |
[in] | y0 | First element of the y-rotation column |
[in] | z0 | First element of the z-rotation column |
[in] | x1 | Second element of the x-rotation column |
[in] | y1 | Second element of the y-rotation column |
[in] | z1 | Second element of the z-rotation column |
[in] | x2 | Third element of the x-rotation column |
[in] | y2 | Third element of the y-rotation column |
[in] | z2 | Third element of the z-rotation column |
Ocular::Math::Matrix3x3::Matrix3x3 | ( | float const * | values | ) |
Creates a new 3x3 column-major matrix.
[in] | values | 9-element float array of values in column-major order ({x0, x1, x2, ..., z2, z3}) |
Ocular::Math::Matrix3x3::Matrix3x3 | ( | Quaternion const & | quat | ) |
Constructs a 3x3 rotational matrix from a quaternion.
[in] | quat |
Ocular::Math::Matrix3x3::Matrix3x3 | ( | Euler const & | euler | ) |
Constructs a 3x3 rotational matrix from a set of Euler angles.
[in] | euler |
Ocular::Math::Matrix3x3::Matrix3x3 | ( | Vector3< float > const & | euler | ) |
Constructs a 3x3 rotational matrix from a set of euler angles.
[in] | euler | (pitch, yaw, roll) |
Ocular::Math::Matrix3x3::Matrix3x3 | ( | ) |
Creates a new identity Matrix
void Ocular::Math::Matrix3x3::getCol | ( | uint32_t | index, |
Vector3< float > & | col | ||
) | const |
Retrieves the value of a single column of the matrix.
[in] | index | Column index [0, 3) |
[out] | col | Vector to store the column values |
void Ocular::Math::Matrix3x3::getData | ( | float * | data | ) | const |
Retrieves the matrix data values as an array of floats.
[out] | data | An array of at least 9 floating point values (if more, only the first 9 are filled). |
float Ocular::Math::Matrix3x3::getElement | ( | uint32_t | index | ) | const |
Returns an individual element of the matrix. Matrix elements are ordered as follows:
{rotX.x, rotX.y, rotX.z, rotY.x, rotY.y, rotY.z, rotZ.x, rotZ.y, rotZ.z}
or
0 3 6 1 4 7 2 5 8
[in] | index | Element index to retrieve. |
Matrix3x3_Internal * Ocular::Math::Matrix3x3::getInternal | ( | ) | const |
For internal use only. Only modify this pointer if you want your application to crash.
void Ocular::Math::Matrix3x3::getRow | ( | uint32_t | index, |
Vector3< float > & | row | ||
) | const |
Retrieves the value of a single row of the matrix.
[in] | index | Row index [0, 3) |
[out] | row | Vector to store the row values |
void Ocular::Math::Matrix3x3::setCol | ( | uint32_t | index, |
Vector3< float > const & | col | ||
) |
Sets the value of a single column of the matrix.
[in] | index | Column index [0,3) |
[in] | col | Vector of column values |
void Ocular::Math::Matrix3x3::setData | ( | float const * | data | ) |
Sets the matrix data values from an array of floats.
[in] | data | An array of at least 9 floating point values (if more, only the first 9 are used). |
void Ocular::Math::Matrix3x3::setElement | ( | uint32_t | index, |
float | value | ||
) |
Sets an individual element of the matrix. Matrix elements are ordered as follows:
{rotX.x, rotX.y, rotX.z, rotY.x, rotY.y, rotY.z, rotZ.x, rotZ.y, rotZ.z}
or
0 3 6 1 4 7 2 5 8
[in] | index | Element index to set [0, 9) |
[in] | value | Value to set the element to |
void Ocular::Math::Matrix3x3::setRow | ( | uint32_t | index, |
Vector3< float > const & | row | ||
) |
Sets the value of a single row of the matrix.
[in] | index | Row index [0,3) |
[in] | row | Vector of row values |