Utility class to manipulate 3x3 matrices of floats. More...
#include <Matrix3.hpp>
Public Member Functions | |
Matrix3 () | |
Default constructor. | |
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. | |
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. | |
Matrix3 | operator* (const Matrix3 &right) const |
Overload of binary operator *. | |
Static Public Member Functions | |
static Matrix3 | Transformation (const Vector2f &origin, const Vector2f &translation, float rotation, const Vector2f &scale) |
Build a matrix from a set of transformations. | |
static Matrix3 | Projection (const Vector2f ¢er, const Vector2f &size, float rotation) |
Build a 2D project matrix. | |
Static Public Attributes | |
static const Matrix3 | Identity |
The identity matrix. |
Utility class to manipulate 3x3 matrices of floats.
Matrix3 is only meant for internal use, its interface is limited and its implementation is optimized for OpenGL rendering.
This type is not used at all in the public API of SFML.
Definition at line 43 of file Matrix3.hpp.
Matrix3::Matrix3 | ( | ) | [inline] |
Default constructor.
This constructor creates an identity matrix.
Definition at line 27 of file Matrix3.inl.
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.
a00 | Element (0, 0) of the matrix |
a01 | Element (0, 1) of the matrix |
a02 | Element (0, 2) of the matrix |
a10 | Element (1, 0) of the matrix |
a11 | Element (1, 1) of the matrix |
a12 | Element (1, 2) of the matrix |
a20 | Element (2, 0) of the matrix |
a21 | Element (2, 1) of the matrix |
a22 | Element (2, 2) of the matrix |
Definition at line 37 of file Matrix3.inl.
const float * Matrix3::Get4x4Elements | ( | ) | const [inline] |
Return the elements of the matrix.
This function returns an array of 16 floats containing the corresponding 4x4 matrix, so that it is directly compatible with OpenGL functions.
Definition at line 85 of file Matrix3.inl.
Matrix3 Matrix3::GetInverse | ( | ) | const [inline] |
Return the inverse of the matrix.
If the inverse cannot be computed, the identity matrix is returned.
Definition at line 57 of file Matrix3.inl.
Overload of binary operator *.
right | Right operand of the multiplication |
Matrix3 Matrix3::Projection | ( | const Vector2f & | center, |
const Vector2f & | size, | ||
float | rotation | ||
) | [inline, static] |
Build a 2D project matrix.
center | Center of the view |
size | Size of the view |
rotation | Angle of rotation of the view, in degrees |
Definition at line 128 of file Matrix3.inl.
Transform a point by the matrix.
point | Point to transform |
Definition at line 49 of file Matrix3.inl.
Matrix3 Matrix3::Transformation | ( | const Vector2f & | origin, |
const Vector2f & | translation, | ||
float | rotation, | ||
const Vector2f & | scale | ||
) | [inline, static] |
Build a matrix from a set of transformations.
origin | Origin for the transformations |
translation | Translation offset |
rotation | Rotation angle in degrees |
scale | Scaling factors |
Definition at line 107 of file Matrix3.inl.
const Matrix3 sf::Matrix3::Identity [static] |
The identity matrix.
Definition at line 148 of file Matrix3.hpp.