Gamedev Framework (gf)
0.3.0
A C++11 framework for 2D games
|
A 3x3 matrix. More...
#include <gf/Matrix.h>
Public Types | |
using | value_type = T |
The value type of the elements of the matrix. More... | |
Public Member Functions | |
Matrix ()=default | |
Default constructor. More... | |
constexpr | Matrix (T xx, T xy, T xz, T yx, T yy, T yz, T zx, T zy, T zz) |
Constructor that takes all the elements. More... | |
Public Attributes | |
union gf::Matrix< T, 3, 3 >:: { ... } | |
T | grid [3][3] |
Grid representation. More... | |
T | data [9] |
Array representation. More... | |
T | xx |
T | xy |
T | xz |
T | yx |
T | yy |
T | yz |
T | zx |
T | zy |
T | zz |
Static Public Attributes | |
static constexpr std::size_t | Rows = 3 |
The number of rows in the matrix. More... | |
static constexpr std::size_t | Cols = 3 |
The number of columns in the matrix. More... | |
A 3x3 matrix.
This specialization of gf::Matrix handles affine transformation of 2D vectors (using homogeneous coordinates).
Each element of the matrix can be accessed through a name with a double letter indicating the column and row of the element (e.g. xy
indicates the first row and second column).
A common typedef is defined:
float
as T
using gf::Matrix< T, 3, 3 >::value_type = T |
The value type of the elements of the matrix.
|
default |
Default constructor.
|
inline |
Constructor that takes all the elements.
xx | The element in the first row and first column |
xy | The element in the first row and second column |
xz | The element in the first row and third column |
yx | The element in the second row and first column |
yy | The element in the second row and second column |
yz | The element in the second row and third column |
zx | The element in the third row and first column |
zy | The element in the third row and second column |
zz | The element in the third row and third column |
union { ... } |
An anonymous union to handle the various representations
|
static |
The number of columns in the matrix.
T gf::Matrix< T, 3, 3 >::data[9] |
Array representation.
T gf::Matrix< T, 3, 3 >::grid[3][3] |
Grid representation.
|
static |
The number of rows in the matrix.
T gf::Matrix< T, 3, 3 >::xx |
T gf::Matrix< T, 3, 3 >::xy |
T gf::Matrix< T, 3, 3 >::xz |
T gf::Matrix< T, 3, 3 >::yx |
T gf::Matrix< T, 3, 3 >::yy |
T gf::Matrix< T, 3, 3 >::yz |
T gf::Matrix< T, 3, 3 >::zx |
T gf::Matrix< T, 3, 3 >::zy |
T gf::Matrix< T, 3, 3 >::zz |