Tizen Native API
5.0
|
A 3x3 matrix. More...
Public Member Functions | |
Matrix3 () | |
Constructor. | |
Matrix3 (const Matrix3 &m) | |
Copy Constructor. | |
Matrix3 (const Matrix &m) | |
Constructor. | |
Matrix3 (float s00, float s01, float s02, float s10, float s11, float s12, float s20, float s21, float s22) | |
Constructor. | |
Matrix3 & | operator= (const Matrix3 &matrix) |
Assignment Operator. | |
Matrix3 & | operator= (const Matrix &matrix) |
Assignment Operator. | |
bool | operator== (const Matrix3 &rhs) const |
The equality operator. | |
bool | operator!= (const Matrix3 &rhs) const |
The inequality operator. | |
~Matrix3 () | |
Destructor. | |
void | SetIdentity () |
Sets the matrix to the identity matrix. | |
const float * | AsFloat () const |
Returns the contents of the matrix as an array of 9 floats. | |
float * | AsFloat () |
Returns the contents of the matrix as an array of 9 floats. | |
bool | Invert () |
Inverts the matrix. | |
bool | Transpose () |
Swaps the rows to columns. | |
void | Scale (float scale) |
Multiplies all elements of the matrix by the scale value. | |
float | Magnitude () const |
Magnitude returns the average of the absolute values of the elements * 3. | |
bool | ScaledInverseTranspose () |
If the matrix is invertible, then this method inverts, transposes and scales the matrix such that the resultant element values average 1. | |
Static Public Member Functions | |
static void | Multiply (Matrix3 &result, const Matrix3 &lhs, const Matrix3 &rhs) |
Function to multiply two matrices and store the result onto third. | |
Static Public Attributes | |
static const Matrix3 | IDENTITY |
The identity matrix. | |
Friends | |
DALI_CORE_API std::ostream & | operator<< (std::ostream &o, const Matrix3 &matrix) |
Prints a 3x3 matrix. |
A 3x3 matrix.
The matrix is stored as a flat array and is Column Major, i.e. the storage order is as follows (numbers represent indices of array):
0 3 6 1 4 7 2 5 8
Each axis is contiguous in memory, so the x-axis corresponds to elements 0, 1 and 2, the y-axis corresponds to elements 3, 4 and 5, and the z-axis corresponds to elements 6, 7 and 8.
Constructor.
Dali::Matrix3::Matrix3 | ( | const Matrix3 & | m | ) |
Copy Constructor.
[in] | m | A reference to the copied 3x3 matrix |
Dali::Matrix3::Matrix3 | ( | const Matrix & | m | ) |
Constructor.
[in] | m | A 4x4 matrix. The translation and shear components are ignored |
Dali::Matrix3::Matrix3 | ( | float | s00, |
float | s01, | ||
float | s02, | ||
float | s10, | ||
float | s11, | ||
float | s12, | ||
float | s20, | ||
float | s21, | ||
float | s22 | ||
) |
Constructor.
[in] | s00 | First element |
[in] | s01 | Second element |
[in] | s02 | Third element |
[in] | s10 | Fourth element |
[in] | s11 | Fifth element |
[in] | s12 | Sixth element |
[in] | s20 | Seventh element |
[in] | s21 | Eighth element |
[in] | s22 | Ninth element |
Destructor.
const float* Dali::Matrix3::AsFloat | ( | ) | const |
Returns the contents of the matrix as an array of 9 floats.
The order of the values for a matrix is:
[ xAxis.x, xAxis.y, xAxis.z, yAxis.x, yAxis.y, yAxis.z, zAxis.x, zAxis.y, zAxis.z ]
float* Dali::Matrix3::AsFloat | ( | ) |
Returns the contents of the matrix as an array of 9 floats.
The order of the values for a matrix is:
[ xAxis.x, xAxis.y, xAxis.z, yAxis.x, yAxis.y, yAxis.z, zAxis.x, zAxis.y, zAxis.z ]
bool Dali::Matrix3::Invert | ( | ) |
Inverts the matrix.
float Dali::Matrix3::Magnitude | ( | ) | const |
Magnitude returns the average of the absolute values of the elements * 3.
(The Magnitude of the unit matrix is therefore 1)
static void Dali::Matrix3::Multiply | ( | Matrix3 & | result, |
const Matrix3 & | lhs, | ||
const Matrix3 & | rhs | ||
) | [static] |
Function to multiply two matrices and store the result onto third.
Use this method in time critical path as it does not require temporaries
result = rhs * lhs
bool Dali::Matrix3::operator!= | ( | const Matrix3 & | rhs | ) | const |
The inequality operator.
Utilizes appropriate machine epsilon values.
[in] | rhs | The Matrix to compare this to |
Assignment Operator.
[in] | matrix | From which to copy values |
Assignment Operator.
[in] | matrix | A reference to the copied matrix |
bool Dali::Matrix3::operator== | ( | const Matrix3 & | rhs | ) | const |
The equality operator.
Utilizes appropriate machine epsilon values.
[in] | rhs | The Matrix to compare this to |
void Dali::Matrix3::Scale | ( | float | scale | ) |
Multiplies all elements of the matrix by the scale value.
[in] | scale | The value by which to scale the whole matrix |
If the matrix is invertible, then this method inverts, transposes and scales the matrix such that the resultant element values average 1.
If the matrix is not invertible, then the matrix is left unchanged.
true
if the matrix is invertible, otherwise false
void Dali::Matrix3::SetIdentity | ( | ) |
Sets the matrix to the identity matrix.
bool Dali::Matrix3::Transpose | ( | ) |
Swaps the rows to columns.
DALI_CORE_API std::ostream& operator<< | ( | std::ostream & | o, |
const Matrix3 & | matrix | ||
) | [friend] |
Prints a 3x3 matrix.
[in] | o | The output stream operator |
[in] | matrix | The matrix to print |