AeonGUI
A portable video game graphic user interface library.
Loading...
Searching...
No Matches
AeonGUI::Matrix2x3 Class Reference

2x3 affine transformation matrix. More...

#include <aeongui/Matrix2x3.hpp>

Public Member Functions

 Matrix2x3 ()
 Default constructor. Initializes to the identity matrix.
 Matrix2x3 (double xx, double yx, double xy, double yy, double x0, double y0)
 Construct from individual matrix elements.
 Matrix2x3 (const std::array< const double, 6 > aMatrixArray)
 Construct from an array of 6 doubles.
 Matrix2x3 (double aRotation)
 Construct a rotation matrix.
 Matrix2x3 (const Vector2 &aScale)
 Construct a scale matrix.
 Matrix2x3 (const Vector2 &aScale, double aRotation)
 Construct a scale-rotation matrix.
 Matrix2x3 (const Vector2 &aScale, double aRotation, const Vector2 &aTranslation)
 Construct a full scale-rotation-translation matrix.
Matrix2x3operator*= (const Matrix2x3 &aRight)
 Multiply this matrix by another (post-multiply).
const double & operator[] (size_t aIndex) const
 Access a matrix element by index.

Detailed Description

2x3 affine transformation matrix.

Represents a 2D affine transform as a 2x3 matrix of the form:

| xx yx |
| xy yy |
| x0 y0 |

Supports construction from scale, rotation, and translation components.

Constructor & Destructor Documentation

◆ Matrix2x3() [1/6]

AeonGUI::Matrix2x3::Matrix2x3 ( double xx,
double yx,
double xy,
double yy,
double x0,
double y0 )

Construct from individual matrix elements.

Parameters
xxRow 0, column 0.
yxRow 0, column 1.
xyRow 1, column 0.
yyRow 1, column 1.
x0Translation X.
y0Translation Y.

◆ Matrix2x3() [2/6]

AeonGUI::Matrix2x3::Matrix2x3 ( const std::array< const double, 6 > aMatrixArray)

Construct from an array of 6 doubles.

Parameters
aMatrixArrayArray in row-major order {xx, yx, xy, yy, x0, y0}.

◆ Matrix2x3() [3/6]

AeonGUI::Matrix2x3::Matrix2x3 ( double aRotation)

Construct a rotation matrix.

Parameters
aRotationRotation angle in radians.

◆ Matrix2x3() [4/6]

AeonGUI::Matrix2x3::Matrix2x3 ( const Vector2 & aScale)

Construct a scale matrix.

Parameters
aScaleScale factors for each axis.

◆ Matrix2x3() [5/6]

AeonGUI::Matrix2x3::Matrix2x3 ( const Vector2 & aScale,
double aRotation )

Construct a scale-rotation matrix.

Parameters
aScaleScale factors for each axis.
aRotationRotation angle in radians.

◆ Matrix2x3() [6/6]

AeonGUI::Matrix2x3::Matrix2x3 ( const Vector2 & aScale,
double aRotation,
const Vector2 & aTranslation )

Construct a full scale-rotation-translation matrix.

Parameters
aScaleScale factors for each axis.
aRotationRotation angle in radians.
aTranslationTranslation vector.

Member Function Documentation

◆ operator*=()

Matrix2x3 & AeonGUI::Matrix2x3::operator*= ( const Matrix2x3 & aRight)

Multiply this matrix by another (post-multiply).

Parameters
aRightThe right-hand-side matrix.
Returns
Reference to this matrix after multiplication.

◆ operator[]()

const double & AeonGUI::Matrix2x3::operator[] ( size_t aIndex) const

Access a matrix element by index.

Parameters
aIndexElement index [0..5].
Returns
Const reference to the element.

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