sf::Matrix3 Class Reference

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

#include <Matrix3.hpp>

List of all members.

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 &center, 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.
Matrix3operator*= (const Matrix3 &right)
 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 43 of file Matrix3.hpp.


Constructor & Destructor Documentation

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.


Member Function Documentation

const float* sf::Matrix3::Get4x4Elements (  )  const

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

Returns:
Pointer to the 4x4 matrix elements
Matrix3 sf::Matrix3::GetInverse (  )  const

Return the inverse of the matrix.

Returns:
A new matrix which is the inverse of this
float sf::Matrix3::operator() ( unsigned int  row,
unsigned int  column 
) const

Operator () overloads to access the matrix elements.

Parameters:
row : Element row (0 based)
column : Element column (0 based)
Returns:
Matrix element (Row, Col)
Matrix3 sf::Matrix3::operator* ( const Matrix3 right  )  const

Operator * overload to multiply two matrices.

Parameters:
right : Matrix to multiply
Returns:
this * right
Matrix3& sf::Matrix3::operator*= ( const Matrix3 right  ) 

Operator *= overload to multiply-assign two matrices.

Parameters:
right : Matrix to multiply
Returns:
this * right
void sf::Matrix3::SetFromProjection ( const Vector2f center,
const Vector2f size,
float  rotation 
)

Build a matrix from a projection.

Parameters:
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.

Parameters:
origin : Origin for the transformations
translation : Translation offset
rotation : Rotation angle in degrees
scale : Scaling factors
Vector2f sf::Matrix3::Transform ( const Vector2f point  )  const

Transform a point by the matrix.

Parameters:
point : Point to transform
Returns:
Transformed point

Member Data Documentation

Identity matrix.

Definition at line 144 of file Matrix3.hpp.


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