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 &origin, const Vector2f &translation, float rotation, const Vector2f &scale) |
Build a matrix from a set of transformations. | |
void | SetFromProjection (const Vector2f ¢er, const Vector2f &size, float rotation) |
Build a matrix from a projection. | |
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 column) const |
Operator () overloads to access the matrix elements. | |
float & | operator() (unsigned int row, unsigned int column) |
Matrix3 | operator* (const Matrix3 &right) const |
Operator * overload to multiply two matrices. | |
Matrix3 & | operator*= (const Matrix3 &right) |
Operator *= overload to multiply-assign two matrices. | |
Static Public Attributes | |
static const Matrix3 | Identity |
Identity matrix. |
Utility class to manipulate 3x3 matrices representing 2D transformations.
Definition at line 43 of file Matrix3.hpp.
sf::Matrix3::Matrix3 | ( | ) |
Default constructor (builds an identity matrix).
sf::Matrix3::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.
const float* sf::Matrix3::Get4x4Elements | ( | ) | const |
Return the elements of the matrix as a 4x4, in an array of 16 floats.
Matrix3 sf::Matrix3::GetInverse | ( | ) | const |
Return the inverse of the matrix.
float sf::Matrix3::operator() | ( | unsigned int | row, | |
unsigned int | column | |||
) | const |
Operator () overloads to access the matrix elements.
row | : Element row (0 based) | |
column | : Element column (0 based) |
Operator * overload to multiply two matrices.
right | : Matrix to multiply |
Operator *= overload to multiply-assign two matrices.
right | : Matrix to multiply |
void sf::Matrix3::SetFromProjection | ( | const Vector2f & | center, | |
const Vector2f & | size, | |||
float | rotation | |||
) |
Build a matrix from a projection.
center | : Center of the view | |
size | : Size of the view | |
rotation | : Angle of rotation of the view rectangle, in degrees |
void sf::Matrix3::SetFromTransformations | ( | const Vector2f & | origin, | |
const Vector2f & | translation, | |||
float | rotation, | |||
const Vector2f & | scale | |||
) |
Build a matrix from a set of transformations.
origin | : Origin for the transformations | |
translation | : Translation offset | |
rotation | : Rotation angle in degrees | |
scale | : Scaling factors |
Transform a point by the matrix.
point | : Point to transform |
const Matrix3 sf::Matrix3::Identity [static] |
Identity matrix.
Definition at line 144 of file Matrix3.hpp.