7#include <boost/qvm_lite.hpp>
71 float data[9] = { 1, 0, 0, 0, 1, 0, 0, 0, 1 };
77template <>
struct mat_traits<
jngl::Mat3> {
78 static int const rows = 3;
79 static int const cols = 3;
80 using scalar_type = float;
82 template <
int R,
int C>
static scalar_type read_element(
const jngl::Mat3& m) {
83 return m.
data[C * 3 + R];
85 template <
int R,
int C>
static scalar_type& write_element(
jngl::Mat3& m) {
86 return m.
data[C * 3 + R];
Mat3(std::initializer_list< float >)
construct matrix from row-major array with 9 elements
Mat3()=default
creates identity matrix
Mat3 & translate(const Vec2 &v)
Multiplies the matrix with a translation matrix generated from v.
Mat3 & scale(float factor)
Multiplies the matrix by a scaling matrix.
Mat3 & rotate(float radian)
Multiplies the matrix with a rotation matrix.
float data[9]
column-major
Mat3 & scale(float xfactor, float yfactor)
Multiplies the matrix by a scaling matrix.
Mat3 & translate(Pixels x, Pixels y)
Multiplies the matrix with a translation matrix generated from (x,y)
Scale-dependent pixels, corresponds to actual pixels on the screen.