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).
 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.
void SetFromTransformations (const Vector2f &Center, const Vector2f &Translation, float Rotation, const Vector2f &Scale)
 Build a matrix from a set of transformations.
Vector2f Transform (const Vector2f &Point) const
 Transform a point by the matrix.
Matrix3 GetInverse () const
 Return the inverse of the matrix.
const float * Get4x4Elements () const
 Return the elements of the matrix as a 4x4, in an array of 16 floats.
float operator() (unsigned int Row, unsigned int Col) const
 Operator () overloads to access the matrix elements.
float & operator() (unsigned int Row, unsigned int Col)
Matrix3 operator* (const Matrix3 &Mat) const
 Operator * overload to multiply two matrices.
Matrix3operator*= (const Matrix3 &Mat)
 Operator *= overload to multiply-assign two matrices.

Static Public Attributes

static const Matrix3 Identity
 Identity matrix.

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 30 of file Matrix3.hpp.

◆ 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 42 of file Matrix3.hpp.

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 119 of file Matrix3.hpp.

◆ 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 88 of file Matrix3.hpp.

◆ operator()() [1/2]

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

Definition at line 145 of file Matrix3.hpp.

◆ operator()() [2/2]

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 128 of file Matrix3.hpp.

◆ 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 167 of file Matrix3.hpp.

◆ 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 184 of file Matrix3.hpp.

◆ 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 56 of file Matrix3.hpp.

◆ 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 78 of file Matrix3.hpp.

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: