#include <Matrix2.hpp>

Public Member Functions

 Matrix2 ()
 
 Matrix2 (const Matrix2 &_obj)
 
 Matrix2 (float _sx, float _shy, float _shx, float _sy, float _tx, float _ty)
 
 Matrix2 (const float *_values)
 
 Matrix2 (const double *_values)
 
void identity ()
 
const Matrix2operator= (const Matrix2 &_obj)
 
bool operator== (const Matrix2 &_obj) const
 
bool operator!= (const Matrix2 &_obj) const
 
const Matrix2operator+= (const Matrix2 &_obj)
 
Matrix2 operator+ (const Matrix2 &_obj) const
 
const Matrix2operator-= (const Matrix2 &_obj)
 
Matrix2 operator- (const Matrix2 &_obj) const
 
const Matrix2operator*= (const Matrix2 &_obj)
 
Matrix2 operator* (const Matrix2 &_obj)
 
vec2 operator* (const vec2 &_point) const
 
vec2 applyScaleRotation (const vec2 &_point) const
 
Matrix2 operator~ () const
 
void flipX ()
 
void flipY ()
 
void scale (const vec2 &_vect)
 
void scale (float _value)
 
void rotate (float _angleRad)
 
void translate (const vec2 &_vect)
 
float determinant () const
 
void invert ()
 

Public Attributes

float m_mat [2 *3]
 

Detailed Description

Transformation matrix for vector 2D.

Constructor & Destructor Documentation

§ Matrix2() [1/5]

etk::Matrix2::Matrix2 ( )

Constructor that load identity.

§ Matrix2() [2/5]

etk::Matrix2::Matrix2 ( const Matrix2 _obj)

Copy constructor.

Parameters
[in]_objMatrix object to copy

§ Matrix2() [3/5]

etk::Matrix2::Matrix2 ( float  _sx,
float  _shy,
float  _shx,
float  _sy,
float  _tx,
float  _ty 
)

Configuration constructor.

Parameters
[in]_sxScale threw X axis
[in]_shyRotate in radian threw Y axis
[in]_shxRotate in radian threw X axis
[in]_syScale threw Y axis
[in]_txTranslate threw X axis
[in]_tytranslate threw Y axis

§ Matrix2() [4/5]

etk::Matrix2::Matrix2 ( const float *  _values)

Configuration constructor.

Parameters
[in]_valuesvector of values in float

§ Matrix2() [5/5]

etk::Matrix2::Matrix2 ( const double *  _values)

Configuration constructor.

Parameters
[in]_valuesvector of values in double

Member Function Documentation

§ applyScaleRotation()

vec2 etk::Matrix2::applyScaleRotation ( const vec2 _point) const

Apply matrix on a vector Scale Rotate, but NOT the translation.

Parameters
[in]_pointPoint value to apply the matrix
Returns
New vector containing the value

§ determinant()

float etk::Matrix2::determinant ( ) const

Computes the determinant of the matrix.

Returns
The determinent Value.

§ flipX()

void etk::Matrix2::flipX ( )

Flip the mathix threw the X axis.

§ flipY()

void etk::Matrix2::flipY ( )

Flip the mathix threw the Y axis.

§ identity()

void etk::Matrix2::identity ( )

Load Identity matrix.

§ invert()

void etk::Matrix2::invert ( )

Inverts the matrix.

Note
The determinant must be != 0, otherwithe the matrix can't be inverted.
Returns
The inverted matrix.

§ operator!=()

bool etk::Matrix2::operator!= ( const Matrix2 _obj) const

In-Equality compare operator with an other object.

Parameters
[in]_objReference on the comparing object
Returns
true The Objects are NOT identical
false The Objects are identical

§ operator*() [1/2]

Matrix2 etk::Matrix2::operator* ( const Matrix2 _obj)

Operator* Multiplication an other matrix with this one.

Parameters
[in]_objReference on the external object
Returns
New vector containing the value

§ operator*() [2/2]

vec2 etk::Matrix2::operator* ( const vec2 _point) const

Operator* apply matrix on a vector.

Parameters
[in]_pointPoint value to apply the matrix
Returns
New vector containing the value

§ operator*=()

const Matrix2& etk::Matrix2::operator*= ( const Matrix2 _obj)

Operator*= Multiplication an other matrix with this one.

Parameters
[in]_objReference on the external object
Returns
Local reference of the vector multiplicated

§ operator+()

Matrix2 etk::Matrix2::operator+ ( const Matrix2 _obj) const

Operator+ Addition an other matrix with this one.

Parameters
[in]_objReference on the external object
Returns
New vector containing the value

§ operator+=()

const Matrix2& etk::Matrix2::operator+= ( const Matrix2 _obj)

Operator+= Addition an other matrix with this one.

Parameters
[in]_objReference on the external object
Returns
Local reference of the vector additionned

§ operator-()

Matrix2 etk::Matrix2::operator- ( const Matrix2 _obj) const

Operator- Decrement an other matrix with this one.

Parameters
[in]_objReference on the external object
Returns
New vector containing the value

§ operator-=()

const Matrix2& etk::Matrix2::operator-= ( const Matrix2 _obj)

Operator-= Decrement an other matrix with this one.

Parameters
[in]_objReference on the external object
Returns
Local reference of the vector decremented

§ operator=()

const Matrix2& etk::Matrix2::operator= ( const Matrix2 _obj)

Operator= Asign the current object with an other object.

Parameters
[in]_objReference on the external object
Returns
Local reference of the vector asigned

§ operator==()

bool etk::Matrix2::operator== ( const Matrix2 _obj) const

Equality compare operator with an other object.

Parameters
[in]_objReference on the comparing object
Returns
true The Objects are identical
false The Objects are NOT identical

§ operator~()

Matrix2 etk::Matrix2::operator~ ( ) const

Inverse the current Matrix.

Returns
New vector containing the value

§ rotate()

void etk::Matrix2::rotate ( float  _angleRad)

Makes a rotation matrix.

Parameters
[in]_angleRadangle to apply.

§ scale() [1/2]

void etk::Matrix2::scale ( const vec2 _vect)

Scale the current Matrix.

Parameters
[in]_vectVector to scale matrix.

§ scale() [2/2]

void etk::Matrix2::scale ( float  _value)

Scale the current Matrix.

Parameters
[in]_valueSingle value to scale in X andf Y.

§ translate()

void etk::Matrix2::translate ( const vec2 _vect)

Makes a translation of the matrix.

Parameters
[in]_vectTranslation to apply.

Member Data Documentation

§ m_mat

float etk::Matrix2::m_mat[2 *3]

Internal data sx shx tx sy shy ty.


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