Public Member Functions | Static Public Member Functions | Static Public Attributes
sf::Matrix3 Class Reference

Utility class to manipulate 3x3 matrices of floats. More...

#include <Matrix3.hpp>

List of all members.

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 &center, const Vector2f &size, float rotation)
 Build a 2D project matrix.

Static Public Attributes

static const Matrix3 Identity
 The identity matrix.

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
a00Element (0, 0) of the matrix
a01Element (0, 1) of the matrix
a02Element (0, 2) of the matrix
a10Element (1, 0) of the matrix
a11Element (1, 1) of the matrix
a12Element (1, 2) of the matrix
a20Element (2, 0) of the matrix
a21Element (2, 1) of the matrix
a22Element (2, 2) of the matrix

Definition at line 37 of file Matrix3.inl.


Member Function Documentation

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.

Returns:
Pointer to the 4x4 matrix elements

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.

Returns:
A new matrix which is the inverse of self

Definition at line 57 of file Matrix3.inl.

Matrix3 sf::Matrix3::operator* ( const Matrix3 right) const

Overload of binary operator *.

Parameters:
rightRight operand of the multiplication
Returns:
New matrix which is the result of self * right
Matrix3 Matrix3::Projection ( const Vector2f center,
const Vector2f size,
float  rotation 
) [inline, static]

Build a 2D project matrix.

Parameters:
centerCenter of the view
sizeSize of the view
rotationAngle of rotation of the view, in degrees
Returns:
New Matrix3 containing the projection
See also:
Transformation

Definition at line 128 of file Matrix3.inl.

Vector2f Matrix3::Transform ( const Vector2f point) const [inline]

Transform a point by the matrix.

Parameters:
pointPoint to transform
Returns:
Transformed point

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.

Parameters:
originOrigin for the transformations
translationTranslation offset
rotationRotation angle in degrees
scaleScaling factors
Returns:
New Matrix3 containing the transformations
See also:
Projection

Definition at line 107 of file Matrix3.inl.


Member Data Documentation

The identity matrix.

Definition at line 148 of file Matrix3.hpp.


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