Public Member Functions | Static Public Attributes | List of all members
sf::Matrix3 Class Reference

Utility class to manipulate 3x3 matrices representing 2D transformations. More...

#include <Matrix3.hpp>

Public Member Functions

 Matrix3 ()
 Default constructor (builds an identity matrix) More...
 
 Matrix3 (float a00, float a01, float a02, float a10, float a11, float a12, float a20, float a21, float a22)
 Construct a matrix from its 9 elements. More...
 
void SetFromTransformations (const Vector2f &Center, const Vector2f &Translation, float Rotation, const Vector2f &Scale)
 Build a matrix from a set of transformations. More...
 
Vector2f Transform (const Vector2f &Point) const
 Transform a point by the matrix. More...
 
Matrix3 GetInverse () const
 Return the inverse of the matrix. More...
 
const float * Get4x4Elements () const
 Return the elements of the matrix as a 4x4, in an array of 16 floats. More...
 
float operator() (unsigned int Row, unsigned int Col) const
 Operator () overloads to access the matrix elements. More...
 
float & operator() (unsigned int Row, unsigned int Col)
 
Matrix3 operator* (const Matrix3 &Mat) const
 Operator * overload to multiply two matrices. More...
 
Matrix3operator*= (const Matrix3 &Mat)
 Operator *= overload to multiply-assign two matrices. More...
 

Static Public Attributes

static const Matrix3 Identity
 Identity matrix. More...
 

Detailed Description

Utility class to manipulate 3x3 matrices representing 2D transformations.

Definition at line 42 of file Matrix3.hpp.

Constructor & Destructor Documentation

◆ Matrix3() [1/2]

Matrix3::Matrix3 ( )
inline

Default constructor (builds an identity matrix)

Definition at line 29 of file Matrix3.inl.

◆ Matrix3() [2/2]

Matrix3::Matrix3 ( float  a00,
float  a01,
float  a02,
float  a10,
float  a11,
float  a12,
float  a20,
float  a21,
float  a22 
)
inline

Construct a matrix from its 9 elements.

Definition at line 41 of file Matrix3.inl.

Member Function Documentation

◆ Get4x4Elements()

const float * Matrix3::Get4x4Elements ( ) const
inline

Return the elements of the matrix as a 4x4, in an array of 16 floats.

Returns
Pointer to the 4x4 matrix elements

Definition at line 118 of file Matrix3.inl.

◆ GetInverse()

Matrix3 Matrix3::GetInverse ( ) const
inline

Return the inverse of the matrix.

Returns
A new matrix which is the inverse of this

Definition at line 87 of file Matrix3.inl.

◆ operator()()

float Matrix3::operator() ( unsigned int  Row,
unsigned int  Col 
) const
inline

Operator () overloads to access the matrix elements.

Parameters
Row: Element row (0 based)
Col: Element column (0 based)
Returns
Matrix element (Row, Col)

Definition at line 127 of file Matrix3.inl.

◆ operator*()

Matrix3 Matrix3::operator* ( const Matrix3 Mat) const
inline

Operator * overload to multiply two matrices.

Parameters
Mat: Matrix to multiply
Returns
this * Mat

Definition at line 166 of file Matrix3.inl.

◆ operator*=()

Matrix3 & Matrix3::operator*= ( const Matrix3 Mat)
inline

Operator *= overload to multiply-assign two matrices.

Parameters
Mat: Matrix to multiply
Returns
this * Mat

Definition at line 183 of file Matrix3.inl.

◆ SetFromTransformations()

void Matrix3::SetFromTransformations ( const Vector2f Center,
const Vector2f Translation,
float  Rotation,
const Vector2f Scale 
)
inline

Build a matrix from a set of transformations.

Parameters
Center: Origin for the transformations
Translation: Translation offset
Rotation: Rotation angle in degrees
Scale: Scaling factors

Definition at line 55 of file Matrix3.inl.

◆ Transform()

Vector2f Matrix3::Transform ( const Vector2f Point) const
inline

Transform a point by the matrix.

Parameters
Point: Point to transform
Returns
Transformed point

Definition at line 77 of file Matrix3.inl.

Member Data Documentation

◆ Identity

const Matrix3 sf::Matrix3::Identity
static

Identity matrix.

Definition at line 133 of file Matrix3.hpp.


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