Gamedev Framework (gf)
0.3.0
A C++11 framework for 2D games
|
A 4x4 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 | |
constexpr | Matrix (T xx, T xy, T xz, T xw, T yx, T yy, T yz, T yw, T zx, T zy, T zz, T zw, T wx, T wy, T wz, T ww) |
Constructor that takes all the elements. More... | |
Public Attributes | |
union gf::Matrix< T, 4, 4 >:: { ... } | |
T | grid [4][4] |
Grid representation. More... | |
T | data [16] |
Array representation. More... | |
T | xx |
T | xy |
T | xz |
T | xw |
T | yx |
T | yy |
T | yz |
T | yw |
T | zx |
T | zy |
T | zz |
T | zw |
T | wx |
T | wy |
T | wz |
T | ww |
Static Public Attributes | |
static constexpr std::size_t | Rows = 4 |
The number of rows in the matrix. More... | |
static constexpr std::size_t | Cols = 4 |
The number of columns in the matrix. More... | |
A 4x4 matrix.
This specialization of gf::Matrix handles affine transformation of 3D 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, 4, 4 >::value_type = T |
The value type of the elements of the matrix.
|
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 |
xw | The element in the first row and fourth 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 |
yw | The element in the second row and fourth 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 |
zw | The element in the third row and fourth column |
wx | The element in the fourth row and first column |
wy | The element in the fourth row and second column |
wz | The element in the fourth row and third column |
ww | The element in the fourth row and fourth column |
union { ... } |
An anonymous union to handle the various representations
|
static |
The number of columns in the matrix.
T gf::Matrix< T, 4, 4 >::data[16] |
Array representation.
T gf::Matrix< T, 4, 4 >::grid[4][4] |
Grid representation.
|
static |
The number of rows in the matrix.
T gf::Matrix< T, 4, 4 >::ww |
T gf::Matrix< T, 4, 4 >::wx |
T gf::Matrix< T, 4, 4 >::wy |
T gf::Matrix< T, 4, 4 >::wz |
T gf::Matrix< T, 4, 4 >::xw |
T gf::Matrix< T, 4, 4 >::xx |
T gf::Matrix< T, 4, 4 >::xy |
T gf::Matrix< T, 4, 4 >::xz |
T gf::Matrix< T, 4, 4 >::yw |
T gf::Matrix< T, 4, 4 >::yx |
T gf::Matrix< T, 4, 4 >::yy |
T gf::Matrix< T, 4, 4 >::yz |
T gf::Matrix< T, 4, 4 >::zw |
T gf::Matrix< T, 4, 4 >::zx |
T gf::Matrix< T, 4, 4 >::zy |
T gf::Matrix< T, 4, 4 >::zz |