Dali 3D User Interface Engine
List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | Friends
Dali::Matrix3 Class Reference

A 3x3 matrix. More...

#include <matrix3.h>

Collaboration diagram for Dali::Matrix3:
Collaboration graph
[legend]

Public Member Functions

 Matrix3 ()
 Constructor. More...
 
 Matrix3 (const Matrix3 &m)
 Copy Constructor. More...
 
 Matrix3 (const Matrix &m)
 Constructor. More...
 
 Matrix3 (float s00, float s01, float s02, float s10, float s11, float s12, float s20, float s21, float s22)
 Constructor. More...
 
Matrix3operator= (const Matrix3 &matrix)
 Assignment Operator .0. More...
 
Matrix3operator= (const Matrix &matrix)
 Assignment Operator .0. More...
 
bool operator== (const Matrix3 &rhs) const
 The equality operator. More...
 
bool operator!= (const Matrix3 &rhs) const
 The inequality operator. More...
 
 ~Matrix3 ()
 Destructor. More...
 
void SetIdentity ()
 Sets the matrix to the identity matrix. More...
 
const float * AsFloat () const
 Returns the contents of the matrix as an array of 9 floats. More...
 
float * AsFloat ()
 Returns the contents of the matrix as an array of 9 floats. More...
 
bool Invert ()
 Inverts the matrix. More...
 
bool Transpose ()
 Swaps the rows to columns .0. More...
 
void Scale (float scale)
 Multiplies all elements of the matrix by the scale value. More...
 
float Magnitude () const
 Magnitude returns the average of the absolute values of the elements * 3. More...
 
bool ScaledInverseTranspose ()
 If the matrix is invertible, then this method inverts, transposes and scales the matrix such that the resultant element values average 1. More...
 

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. More...
 

Static Public Attributes

static const Matrix3 IDENTITY
 The identity matrix. More...
 

Private Attributes

float mElements [9]
 The elements of the matrix. More...
 

Friends

std::ostream & operator<< (std::ostream &o, const Matrix3 &matrix)
 Print a 3x3 matrix. More...
 

Detailed Description

A 3x3 matrix.

.0

Definition at line 41 of file matrix3.h.

Constructor & Destructor Documentation

Dali::Matrix3::Matrix3 ( )

Constructor.

.0

Definition at line 57 of file matrix3.cpp.

References AsFloat(), and anonymous_namespace{matrix3.cpp}::NUM_BYTES_IN_MATRIX.

Here is the call graph for this function:

Dali::Matrix3::Matrix3 ( const Matrix3 m)

Copy Constructor.

.0

Parameters
[in]mAnother 3x3 matrix

Definition at line 63 of file matrix3.cpp.

References mElements, and anonymous_namespace{matrix3.cpp}::NUM_BYTES_IN_MATRIX.

Dali::Matrix3::Matrix3 ( const Matrix m)

Constructor.

.0

Parameters
[in]mA 4x4 matrix. The translation and shear components are ignored.

Definition at line 68 of file matrix3.cpp.

References Dali::Matrix::AsFloat(), anonymous_namespace{utc-Dali-Matrix3.cpp}::m4, mElements, anonymous_namespace{matrix3.cpp}::NUM_BYTES_IN_ROW, S00, S10, and S20.

Here is the call graph for this function:

Dali::Matrix3::Matrix3 ( float  s00,
float  s01,
float  s02,
float  s10,
float  s11,
float  s12,
float  s20,
float  s21,
float  s22 
)

Constructor.

.0

Parameters
[in]s00First element
[in]s01Second element
[in]s02Third element
[in]s10Fourth element
[in]s11Fifth element
[in]s12Sixth element
[in]s20Seventh element
[in]s21Eighth element
[in]s22Ninth element

Definition at line 76 of file matrix3.cpp.

References mElements, S00, S01, S02, S10, S11, S12, S20, S21, and S22.

Dali::Matrix3::~Matrix3 ( )
inline

Destructor.

.0

Definition at line 132 of file matrix3.h.

Member Function Documentation

const float* Dali::Matrix3::AsFloat ( ) const
inline

Returns the contents of the matrix as an array of 9 floats.

The order of the values for a matrix is: xAxis.x yAxis.x zAxis.x xAxis.y yAxis.y zAxis.y xAxis.z yAxis.z zAxis.z .0

Returns
the matrix contents as an array of 9 floats.

Definition at line 152 of file matrix3.h.

Referenced by DALI_TEST_EQUALS(), Matrix3(), Dali::Integration::Log::Matrix3ToString(), Multiply(), operator=(), Dali::Internal::anonymous_namespace{render-renderer.cpp}::SetMatrices(), Dali::Internal::Render::Renderer::SetUniformFromProperty(), Dali::Internal::SceneGraph::Shader::SetUniforms(), UtcDaliMatrix3AsFloat(), and UtcDaliMatrix3Invert().

Here is the caller graph for this function:

float* Dali::Matrix3::AsFloat ( )
inline

Returns the contents of the matrix as an array of 9 floats.

The order of the values for a matrix is: xAxis.x yAxis.x zAxis.x xAxis.y yAxis.y zAxis.y xAxis.z yAxis.z zAxis.z .0

Returns
the matrix contents as an array of 9 floats.

Definition at line 164 of file matrix3.h.

bool Dali::Matrix3::Invert ( )
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) .0

Returns
the magnitude - always positive.

Definition at line 223 of file matrix3.cpp.

References mElements.

Referenced by UtcDaliMatrix3Magnitude(), and UtcDaliMatrix3ScaleInverseTranspose().

Here is the caller graph for this function:

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 .0

Parameters
resultof the multiplication
lhsmatrix, this can be same matrix as result
rhsmatrix, this cannot be same matrix as result

Definition at line 234 of file matrix3.cpp.

References AsFloat(), Dali::anonymous_namespace{compile-time-math.cpp}::value0, Dali::anonymous_namespace{compile-time-math.cpp}::value1, and Dali::anonymous_namespace{compile-time-math.cpp}::value2.

Referenced by Dali::Internal::SceneGraph::AnimatableProperty< Matrix3 >::BakeRelative(), Dali::Internal::SceneGraph::AnimatableProperty< Matrix3 >::SetRelative(), and UtcDaliMatrix3Multiply().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Dali::Matrix3::operator!= ( const Matrix3 rhs) const

The inequality operator.

Utilises appropriate machine epsilon values.

.0

Parameters
[in]rhsthe Matrix to compare this to
Returns
true if the matrices are equal

Definition at line 277 of file matrix3.cpp.

Matrix3 & Dali::Matrix3::operator= ( const Matrix3 matrix)

Assignment Operator .0.

Parameters
matrixfrom which to copy values
Returns
reference to this object

Definition at line 98 of file matrix3.cpp.

References AsFloat(), and anonymous_namespace{matrix3.cpp}::NUM_BYTES_IN_MATRIX.

Here is the call graph for this function:

Matrix3 & Dali::Matrix3::operator= ( const Matrix matrix)

Assignment Operator .0.

Parameters
matrixfrom which to copy values
Returns
reference to this object

Definition at line 108 of file matrix3.cpp.

References Dali::Matrix::AsFloat(), anonymous_namespace{utc-Dali-Matrix3.cpp}::m4, mElements, anonymous_namespace{matrix3.cpp}::NUM_BYTES_IN_ROW, S00, S10, and S20.

Here is the call graph for this function:

bool Dali::Matrix3::operator== ( const Matrix3 rhs) const

The equality operator.

Utilises appropriate machine epsilon values.

.0

Parameters
[in]rhsthe Matrix to compare this to
Returns
true if the matrices are equal

Definition at line 263 of file matrix3.cpp.

References Dali::Equals(), and mElements.

Here is the call graph for this function:

void Dali::Matrix3::Scale ( float  scale)

Multiplies all elements of the matrix by the scale value.

.0

Parameters
scale- the value by which to scale the whole matrix.

Definition at line 210 of file matrix3.cpp.

References mElements, S00, S01, S02, S10, S11, S12, S20, S21, and S22.

Referenced by UtcDaliMatrix3Scale(), and UtcDaliMatrix3ScaleInverseTranspose().

Here is the caller graph for this function:

bool Dali::Matrix3::ScaledInverseTranspose ( )

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.

.0

Returns
true if the matrix is invertible, otherwise false

Definition at line 158 of file matrix3.cpp.

References Dali::EqualsZero(), mElements, S00, S01, S02, S10, S11, S12, S20, S21, and S22.

Referenced by UtcDaliMatrix3ScaleInverseTranspose().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Matrix3::SetIdentity ( )

Sets the matrix to the identity matrix.

.0

Definition at line 90 of file matrix3.cpp.

References mElements, anonymous_namespace{matrix3.cpp}::NUM_BYTES_IN_MATRIX, S00, S11, and S22.

Referenced by UtcDaliMatrix3SetIdentity().

Here is the caller graph for this function:

bool Dali::Matrix3::Transpose ( )

Swaps the rows to columns .0.

Returns
true

Definition at line 149 of file matrix3.cpp.

References mElements, S01, S02, S10, S12, S20, and S21.

Referenced by Dali::Internal::anonymous_namespace{render-renderer.cpp}::SetMatrices(), UtcDaliMatrix3ScaleInverseTranspose(), and UtcDaliMatrix3Transpose().

Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
const Matrix3 matrix 
)
friend

Print a 3x3 matrix.

.0

Parameters
[in]oThe output stream operator.
[in]matrixThe matrix to print.
Returns
The output stream operator.

Definition at line 282 of file matrix3.cpp.

Member Data Documentation

const Matrix3 Dali::Matrix3::IDENTITY
static
float Dali::Matrix3::mElements[9]
private

The elements of the matrix.

Definition at line 225 of file matrix3.h.

Referenced by Invert(), Magnitude(), Matrix3(), Dali::operator<<(), operator=(), operator==(), Scale(), ScaledInverseTranspose(), SetIdentity(), and Transpose().


The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali