Ultralight C++ API 1.3.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 |
typedef double ultralight::Matrix::Aligned4x4[4][4] |
|
inline |
Transform point by this matrix and get the result.
Transform rect by this matrix and get the result as an axis-aligned rect.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool ultralight::Matrix::GetInverse | ( | Matrix & | result | ) | const |
Get the inverse of this matrix.
May return false if not invertible.
Matrix4x4 ultralight::Matrix::GetMatrix4x4 | ( | ) | const |
Get this matrix as unaligned 4x4 float components (for use passing to GPU driver APIs).
uint32_t ultralight::Matrix::Hash | ( | ) | const |
Get an integer hash of this matrix's members.
bool ultralight::Matrix::IsAffine | ( | ) | const |
Whether or not this matrix uses only affine transformations.
bool ultralight::Matrix::IsIdentity | ( | ) | const |
Whether or not this is an identity matrix.
bool ultralight::Matrix::IsIdentityOrTranslation | ( | ) | const |
Whether or not this is an identity matrix or translation.
bool ultralight::Matrix::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 ultralight::Matrix::Rotate | ( | double | theta | ) |
Rotate matrix by theta (in degrees)
void ultralight::Matrix::Rotate | ( | double | x, |
double | y | ||
) |
Rotate matrix by x and y.
void ultralight::Matrix::Scale | ( | double | x, |
double | y | ||
) |
Scale by x and y.
void ultralight::Matrix::Set | ( | const Matrix & | other | ) |
Set to another matrix.
void ultralight::Matrix::Set | ( | const Matrix4x4 & | other | ) |
Set to another matrix.
void ultralight::Matrix::Set | ( | double | a, |
double | b, | ||
double | c, | ||
double | d, | ||
double | e, | ||
double | f | ||
) |
Set from raw affine members.
void ultralight::Matrix::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 ultralight::Matrix::SetIdentity | ( | ) |
Set to identity matrix.
void ultralight::Matrix::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 ultralight::Matrix::Translate | ( | double | x, |
double | y | ||
) |
Translate by x and y.
Aligned4x4 ultralight::Matrix::data |