kanzi::Matrix3x3 Class Reference

Matrix with 3x3 elements. More...

#include <kanzi/core/math/matrix3x3.hpp>

Public Member Functions

 Matrix3x3 ()
 Default constructor, initializes the matrix to identity matrix. More...
 
 Matrix3x3 (float x0, float x1, float x2, float x3, float x4, float x5, float x6, float x7, float x8)
 Constructs the matrix from elements. More...
 
 Matrix3x3 (const Vector2 &x, const Vector2 &y, const Vector2 &translation)
 Constructs the matrix from 3 vectors. More...
 
const float & operator[] (size_t index) const
 Access to individual elements of the matrix. More...
 
float & operator[] (size_t index)
 Access to individual elements of the matrix. More...
 
Vector2 getXAxis () const
 
Vector2 getYAxis () const
 
Vector2 getTranslation () const
 
float getScaleX () const
 Get X scale component. More...
 
float getScaleY () const
 Get Y scale component. More...
 
Vector2 getScale () const
 Get scale as a vector. More...
 
void scale (const Vector2 &v)
 
void setXAxis (Vector2 v)
 
void setYAxis (Vector2 v)
 
void setTranslation (Vector2 translation)
 Set translation. More...
 
void setTranslation (float translationX, float translationY)
 Set translation. More...
 
float getTranslationX () const
 Get translation on X axis. More...
 
void setTranslationX (float translationX)
 Set translation on X axis. More...
 
float getTranslationY () const
 Get translation on Y axis. More...
 
void setTranslationY (float translationY)
 Set translation on Y axis. More...
 
Matrix3x3operator+= (const Matrix3x3 &m)
 Modifies this matrix by adding another matrix. More...
 
Matrix3x3operator-= (const Matrix3x3 &m)
 Modifies this matrix by subtracting another matrix from this matrix. More...
 
Matrix3x3operator*= (const Matrix3x3 &m)
 Modifies this matrix by multiplying it with another matrix. More...
 

Static Public Member Functions

static Matrix3x3 createTranslation (Vector2 translation)
 
static Matrix3x3 createTranslation (float x, float y)
 
static Matrix3x3 createScale (Vector2 scale)
 
static Matrix3x3 createIdentity ()
 
static Matrix3x3 createRotationInDegrees (float angleInDegrees)
 
static Matrix3x3 createRotationInRadians (float angleInRadians)
 
static Matrix3x3 createSRT (Vector2 scale, float rotationInRadians, Vector2 translation)
 Create an SRT matrix. More...
 

Detailed Description

Matrix with 3x3 elements.

Constructor & Destructor Documentation

kanzi::Matrix3x3::Matrix3x3 ( )
inlineexplicit

Default constructor, initializes the matrix to identity matrix.

kanzi::Matrix3x3::Matrix3x3 ( float  x0,
float  x1,
float  x2,
float  x3,
float  x4,
float  x5,
float  x6,
float  x7,
float  x8 
)
inlineexplicit

Constructs the matrix from elements.

kanzi::Matrix3x3::Matrix3x3 ( const Vector2 x,
const Vector2 y,
const Vector2 translation 
)
inlineexplicit

Constructs the matrix from 3 vectors.

Member Function Documentation

const float& kanzi::Matrix3x3::operator[] ( size_t  index) const
inline

Access to individual elements of the matrix.

Parameters
indexIndex of the accessed element. Should be at least 0 and at most 15.
Returns
float& kanzi::Matrix3x3::operator[] ( size_t  index)
inline

Access to individual elements of the matrix.

Parameters
indexIndex of the accessed element. Should be at least 0 and at most 15.
Returns
Vector2 kanzi::Matrix3x3::getXAxis ( ) const
inline
Vector2 kanzi::Matrix3x3::getYAxis ( ) const
inline
Vector2 kanzi::Matrix3x3::getTranslation ( ) const
inline
float kanzi::Matrix3x3::getScaleX ( ) const
inline

Get X scale component.

float kanzi::Matrix3x3::getScaleY ( ) const
inline

Get Y scale component.

Vector2 kanzi::Matrix3x3::getScale ( ) const
inline

Get scale as a vector.

void kanzi::Matrix3x3::scale ( const Vector2 v)
inline
void kanzi::Matrix3x3::setXAxis ( Vector2  v)
inline
void kanzi::Matrix3x3::setYAxis ( Vector2  v)
inline
void kanzi::Matrix3x3::setTranslation ( Vector2  translation)
inline

Set translation.

Parameters
translationTranslation vector.
void kanzi::Matrix3x3::setTranslation ( float  translationX,
float  translationY 
)
inline

Set translation.

Parameters
translationXTranslation X component.
translationYTranslation Y component.
float kanzi::Matrix3x3::getTranslationX ( ) const
inline

Get translation on X axis.

Returns
Translation X component.
void kanzi::Matrix3x3::setTranslationX ( float  translationX)
inline

Set translation on X axis.

Parameters
translationXTranslation X component.
float kanzi::Matrix3x3::getTranslationY ( ) const
inline

Get translation on Y axis.

Returns
Translation Y component.
void kanzi::Matrix3x3::setTranslationY ( float  translationY)
inline

Set translation on Y axis.

Parameters
translationYTranslation Y component.
Matrix3x3& kanzi::Matrix3x3::operator+= ( const Matrix3x3 m)
inline

Modifies this matrix by adding another matrix.

Parameters
mAnother matrix.
Returns
This matrix.
Matrix3x3& kanzi::Matrix3x3::operator-= ( const Matrix3x3 m)
inline

Modifies this matrix by subtracting another matrix from this matrix.

Parameters
mAnother matrix.
Returns
This matrix.
Matrix3x3& kanzi::Matrix3x3::operator*= ( const Matrix3x3 m)

Modifies this matrix by multiplying it with another matrix.

Parameters
mAnother matrix.
Returns
This matrix.
static Matrix3x3 kanzi::Matrix3x3::createTranslation ( Vector2  translation)
inlinestatic
static Matrix3x3 kanzi::Matrix3x3::createTranslation ( float  x,
float  y 
)
inlinestatic
static Matrix3x3 kanzi::Matrix3x3::createScale ( Vector2  scale)
inlinestatic
static Matrix3x3 kanzi::Matrix3x3::createIdentity ( )
inlinestatic
static Matrix3x3 kanzi::Matrix3x3::createRotationInDegrees ( float  angleInDegrees)
static
static Matrix3x3 kanzi::Matrix3x3::createRotationInRadians ( float  angleInRadians)
static
static Matrix3x3 kanzi::Matrix3x3::createSRT ( Vector2  scale,
float  rotationInRadians,
Vector2  translation 
)
static

Create an SRT matrix.

Parameters
scaleScales by axises.
rotationInRadiansRotation component in radians.
translationTranslation component.
Returns
Newly constructed matrix.

The documentation for this class was generated from the following file: