Helper class for exchanging 3x3 transform matrices. More...
#include <InstantIO/Matrix3.h>
Public Types | |
enum | MatrixElementIndex { M_00 = 0, M_01 = 1, M_02 = 2, M_10 = 3, M_11 = 4, M_12 = 5, M_20 = 6, M_21 = 7, M_22 = 8 } |
Defines symbolic indices for the elements of the matrix. | |
Public Member Functions | |
Matrix3 () | |
Creates a new Matrix3 object that contains an identity matrix. | |
Matrix3 (const Matrix3 &obj) | |
Creates a new Matrix3 object that is an exact copy of another Matrix3 object. | |
Matrix3 (const T matrix[9], bool transposed=false) | |
Creates a new Matrix3 object that gets initialized by a given 9 component float array representing a 3x3 matrix. | |
const Matrix3 & | operator= (const Matrix3 &obj) |
Assigns another Matrix3 to this Matrix3. | |
const T * | operator= (const T matrix[9]) |
Assigns the nine components of an float array to this Matrix3. | |
void | setIdentity () |
Sets the Matrix3 to identity. | |
T | operator[] (MatrixElementIndex i) const |
Returns a component of the Matrix3. | |
T & | operator[] (MatrixElementIndex i) |
Returns a component of the Matrix3. | |
const T * | getValue () const |
Returns the components of the Matrix3 as an array of nine float values. | |
T * | getValue () |
Returns the components of the Matrix3 as an array of nine float values. | |
operator T * () | |
Transforms the Matrix3 to an array of 9 float values. | |
operator const T * () const | |
Transforms the Matrix3 to an array of 9 float values. |
Helper class for exchanging 3x3 transform matrices.
Matrix3 is a basic helper class for exchanging transformations between different software components. It does not contain any means for matrix arithmetics, only methods for setting and getting the transformation. It is not meant to be used directly by software components for matrix representation. Instead, software components should use their own, appropriate classes for handling matrices. Only when sending matrices to an OutSlot, or when receiving matrices from an InSlot, the internal representation of matrices should be converted to Matrix3's. This ensures the interoperability between different software components that use different internal representations for matrices.
Matrices are internally stored as 3x3 matrices. You can access these matrices directly, or you can use methods that convert a translation vector, a quaternion axis and a scale vector to a Matrix3.
InstantIO::Matrix3< T >::Matrix3 | ( | const Matrix3< T > & | obj | ) | [inline] |
Creates a new Matrix3 object that is an exact copy of another Matrix3 object.
obj | The other Matrix3 object |
InstantIO::Matrix3< T >::Matrix3 | ( | const T | matrix[9], | |
bool | transposed = false | |||
) | [inline] |
Creates a new Matrix3 object that gets initialized by a given 9 component float array representing a 3x3 matrix.
matrix | The nine components of the matrix | |
transposed | Flags that must be set to true when the array needs to be transposed when copying it into the Matrix3 object |
const Matrix3& InstantIO::Matrix3< T >::operator= | ( | const Matrix3< T > & | obj | ) | [inline] |
Assigns another Matrix3 to this Matrix3.
obj | The other Matrix3 object |
const T* InstantIO::Matrix3< T >::operator= | ( | const T | matrix[9] | ) | [inline] |
Assigns the nine components of an float array to this Matrix3.
matrix | The nine components of the matrix |
T InstantIO::Matrix3< T >::operator[] | ( | MatrixElementIndex | i | ) | const [inline] |
Returns a component of the Matrix3.
i | The index of the component |
T& InstantIO::Matrix3< T >::operator[] | ( | MatrixElementIndex | i | ) | [inline] |
Returns a component of the Matrix3.
i | The index of the component |
const T* InstantIO::Matrix3< T >::getValue | ( | ) | const [inline] |
Returns the components of the Matrix3 as an array of nine float values.
T* InstantIO::Matrix3< T >::getValue | ( | ) | [inline] |
Returns the components of the Matrix3 as an array of nine float values.
InstantIO::Matrix3< T >::operator T * | ( | ) | [inline] |
Transforms the Matrix3 to an array of 9 float values.
InstantIO::Matrix3< T >::operator const T * | ( | ) | const [inline] |
Transforms the Matrix3 to an array of 9 float values.