34 typedef double Aligned4x4[4][4];
66 void Set(
double a,
double b,
double c,
double d,
double e,
double f);
71 void Set(
double m11,
double m12,
double m13,
double m14,
72 double m21,
double m22,
double m23,
double m24,
73 double m31,
double m32,
double m33,
double m34,
74 double m41,
double m42,
double m43,
double m44);
76 inline double m11()
const {
return data[0][0]; }
77 inline double m12()
const {
return data[0][1]; }
78 inline double m13()
const {
return data[0][2]; }
79 inline double m14()
const {
return data[0][3]; }
80 inline double m21()
const {
return data[1][0]; }
81 inline double m22()
const {
return data[1][1]; }
82 inline double m23()
const {
return data[1][2]; }
83 inline double m24()
const {
return data[1][3]; }
84 inline double m31()
const {
return data[2][0]; }
85 inline double m32()
const {
return data[2][1]; }
86 inline double m33()
const {
return data[2][2]; }
87 inline double m34()
const {
return data[2][3]; }
88 inline double m41()
const {
return data[3][0]; }
89 inline double m42()
const {
return data[3][1]; }
90 inline double m43()
const {
return data[3][2]; }
91 inline double m44()
const {
return data[3][3]; }
93 inline double a()
const {
return data[0][0]; }
94 inline double b()
const {
return data[0][1]; }
95 inline double c()
const {
return data[1][0]; }
96 inline double d()
const {
return data[1][1]; }
97 inline double e()
const {
return data[3][0]; }
98 inline double f()
const {
return data[3][1]; }
#define UExport
Definition Exports.h:25
bool operator==(const Matrix &a, const Matrix &b)
bool operator!=(const Matrix &a, const Matrix &b)
4x4 Matrix Helper
Definition Matrix.h:18
void SetIdentity()
Set to identity matrix.
Transformation Matrix helper.
Definition Matrix.h:33
void Translate(double x, double y)
Translate by x and y.
double e() const
Definition Matrix.h:97
bool IsAffine() const
Whether or not this matrix uses only affine transformations.
bool IsIdentity() const
Whether or not this is an identity matrix.
Point Apply(const Point &p) const
Transform point by this matrix and get the result.
void SetIdentity()
Set to identity matrix.
double m42() const
Definition Matrix.h:89
uint32_t Hash() const
Get an integer hash of this matrix's members.
Aligned4x4 data
Raw matrix data in column-major order (eg, data[column][row])
Definition Matrix.h:39
double b() const
Definition Matrix.h:94
double m32() const
Definition Matrix.h:85
bool IsIdentityOrTranslation() const
Whether or not this is an identity matrix or translation.
double m23() const
Definition Matrix.h:82
bool IsSimple() const
Whether or not this is an identity, translation, or non-negative uniform scale.
void Set(double a, double b, double c, double d, double e, double f)
Set from raw affine members.
void Rotate(double theta)
Rotate matrix by theta (in degrees)
double m21() const
Definition Matrix.h:80
void Set(double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24, double m31, double m32, double m33, double m34, double m41, double m42, double m43, double m44)
Set from raw 4x4 components.
double m12() const
Definition Matrix.h:77
void Set(const Matrix &other)
Set to another matrix.
Rect Apply(const Rect &r) const
Transform rect by this matrix and get the result as an axis-aligned rect.
double a() const
Definition Matrix.h:93
double m14() const
Definition Matrix.h:79
double m34() const
Definition Matrix.h:87
bool GetInverse(Matrix &result) const
Get the inverse of this matrix.
double m43() const
Definition Matrix.h:90
void Rotate(double x, double y)
Rotate matrix by x and y.
double m41() const
Definition Matrix.h:88
double m44() const
Definition Matrix.h:91
void SetOrthographicProjection(double screen_width, double screen_height, bool flip_y)
Set to an orthographic projection matrix suitable for use with our vertex shaders.
void Set(const Matrix4x4 &other)
Set to another matrix.
double m11() const
Definition Matrix.h:76
double m24() const
Definition Matrix.h:83
Matrix4x4 GetMatrix4x4() const
Get this matrix as unaligned 4x4 float components (for use passing to GPU driver APIs).
double m13() const
Definition Matrix.h:78
double m22() const
Definition Matrix.h:81
void Scale(double x, double y)
Scale by x and y.
double c() const
Definition Matrix.h:95
double d() const
Definition Matrix.h:96
void Transform(const Matrix &other)
Transform (multiply) by another Matrix.
double f() const
Definition Matrix.h:98
double m33() const
Definition Matrix.h:86
double m31() const
Definition Matrix.h:84
Float Rectangle Helper.
Definition Geometry.h:419
2D Vector Helper
Definition Geometry.h:20