Ultralight C++ API 1.4.0
|
#include <Ultralight/Matrix.h>
Transformation Matrix helper.
Public Types | |
typedef double | Aligned4x4[4][4] |
Public Member Functions | |
void | SetIdentity () |
Set to identity matrix. | |
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 Matrix &other) |
Set to another matrix. | |
void | Set (const Matrix4x4 &other) |
Set to another matrix. | |
void | Set (double a, double b, double c, double d, double e, double f) |
Set from raw affine members. | |
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 | m11 () const |
double | m12 () const |
double | m13 () const |
double | m14 () const |
double | m21 () const |
double | m22 () const |
double | m23 () const |
double | m24 () const |
double | m31 () const |
double | m32 () const |
double | m33 () const |
double | m34 () const |
double | m41 () const |
double | m42 () const |
double | m43 () const |
double | m44 () const |
double | a () const |
double | b () const |
double | c () const |
double | d () const |
double | e () const |
double | f () const |
bool | IsIdentity () const |
Whether or not this is an identity matrix. | |
bool | IsIdentityOrTranslation () const |
Whether or not this is an identity matrix or translation. | |
bool | IsAffine () const |
Whether or not this matrix uses only affine transformations. | |
bool | IsSimple () const |
Whether or not this is an identity, translation, or non-negative uniform scale. | |
void | Translate (double x, double y) |
Translate by x and y. | |
void | Scale (double x, double y) |
Scale by x and y. | |
void | Rotate (double theta) |
Rotate matrix by theta (in degrees) | |
void | Rotate (double x, double y) |
Rotate matrix by x and y. | |
void | Transform (const Matrix &other) |
Transform (multiply) by another Matrix. | |
bool | GetInverse (Matrix &result) const |
Get the inverse of this matrix. | |
Point | Apply (const Point &p) const |
Transform point by this matrix and get the result. | |
Rect | Apply (const Rect &r) const |
Transform rect by this matrix and get the result as an axis-aligned rect. | |
uint32_t | Hash () const |
Get an integer hash of this matrix's members. | |
Matrix4x4 | GetMatrix4x4 () const |
Get this matrix as unaligned 4x4 float components (for use passing to GPU driver APIs). | |
Public Attributes | |
Aligned4x4 | data |
Raw matrix data in column-major order (eg, data[column][row] ) | |
typedef double Aligned4x4[4][4] |
|
inline |
Transform rect by this matrix and get the result as an axis-aligned rect.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool GetInverse | ( | Matrix & | result | ) | const |
Get the inverse of this matrix.
May return false if not invertible.
Matrix4x4 GetMatrix4x4 | ( | ) | const |
Get this matrix as unaligned 4x4 float components (for use passing to GPU driver APIs).
uint32_t Hash | ( | ) | const |
Get an integer hash of this matrix's members.
bool IsAffine | ( | ) | const |
Whether or not this matrix uses only affine transformations.
bool IsIdentity | ( | ) | const |
Whether or not this is an identity matrix.
bool IsIdentityOrTranslation | ( | ) | const |
Whether or not this is an identity matrix or translation.
bool IsSimple | ( | ) | const |
Whether or not this is an identity, translation, or non-negative uniform scale.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void Rotate | ( | double | theta | ) |
Rotate matrix by theta (in degrees)
void Rotate | ( | double | x, |
double | y ) |
Rotate matrix by x and y.
void Scale | ( | double | x, |
double | y ) |
Scale by x and y.
void Set | ( | const Matrix & | other | ) |
Set to another matrix.
void Set | ( | const Matrix4x4 & | other | ) |
Set to another matrix.
void Set | ( | double | a, |
double | b, | ||
double | c, | ||
double | d, | ||
double | e, | ||
double | f ) |
Set from raw affine members.
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.
void SetIdentity | ( | ) |
Set to identity matrix.
void SetOrthographicProjection | ( | double | screen_width, |
double | screen_height, | ||
bool | flip_y ) |
Set to an orthographic projection matrix suitable for use with our vertex shaders.
Optionally flip the y-coordinate space (eg, for OpenGL).
void Translate | ( | double | x, |
double | y ) |
Translate by x and y.
Aligned4x4 data |
Raw matrix data in column-major order (eg, data[column][row]
)