Ultralight C++ API 1.3.0
Loading...
Searching...
No Matches
ultralight::Matrix Struct Reference

#include <Ultralight/Matrix.h>

Details

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
 

Member Typedef Documentation

◆ Aligned4x4

typedef double ultralight::Matrix::Aligned4x4[4][4]

Member Function Documentation

◆ a()

double ultralight::Matrix::a ( ) const
inline

◆ Apply() [1/2]

Point ultralight::Matrix::Apply ( const Point p) const

Transform point by this matrix and get the result.

◆ Apply() [2/2]

Rect ultralight::Matrix::Apply ( const Rect r) const

Transform rect by this matrix and get the result as an axis-aligned rect.

◆ b()

double ultralight::Matrix::b ( ) const
inline

◆ c()

double ultralight::Matrix::c ( ) const
inline

◆ d()

double ultralight::Matrix::d ( ) const
inline

◆ e()

double ultralight::Matrix::e ( ) const
inline

◆ f()

double ultralight::Matrix::f ( ) const
inline

◆ GetInverse()

bool ultralight::Matrix::GetInverse ( Matrix result) const

Get the inverse of this matrix.

May return false if not invertible.

◆ GetMatrix4x4()

Matrix4x4 ultralight::Matrix::GetMatrix4x4 ( ) const

Get this matrix as unaligned 4x4 float components (for use passing to GPU driver APIs).

◆ Hash()

uint32_t ultralight::Matrix::Hash ( ) const

Get an integer hash of this matrix's members.

◆ IsAffine()

bool ultralight::Matrix::IsAffine ( ) const

Whether or not this matrix uses only affine transformations.

◆ IsIdentity()

bool ultralight::Matrix::IsIdentity ( ) const

Whether or not this is an identity matrix.

◆ IsIdentityOrTranslation()

bool ultralight::Matrix::IsIdentityOrTranslation ( ) const

Whether or not this is an identity matrix or translation.

◆ IsSimple()

bool ultralight::Matrix::IsSimple ( ) const

Whether or not this is an identity, translation, or non-negative uniform scale.

◆ m11()

double ultralight::Matrix::m11 ( ) const
inline

◆ m12()

double ultralight::Matrix::m12 ( ) const
inline

◆ m13()

double ultralight::Matrix::m13 ( ) const
inline

◆ m14()

double ultralight::Matrix::m14 ( ) const
inline

◆ m21()

double ultralight::Matrix::m21 ( ) const
inline

◆ m22()

double ultralight::Matrix::m22 ( ) const
inline

◆ m23()

double ultralight::Matrix::m23 ( ) const
inline

◆ m24()

double ultralight::Matrix::m24 ( ) const
inline

◆ m31()

double ultralight::Matrix::m31 ( ) const
inline

◆ m32()

double ultralight::Matrix::m32 ( ) const
inline

◆ m33()

double ultralight::Matrix::m33 ( ) const
inline

◆ m34()

double ultralight::Matrix::m34 ( ) const
inline

◆ m41()

double ultralight::Matrix::m41 ( ) const
inline

◆ m42()

double ultralight::Matrix::m42 ( ) const
inline

◆ m43()

double ultralight::Matrix::m43 ( ) const
inline

◆ m44()

double ultralight::Matrix::m44 ( ) const
inline

◆ Rotate() [1/2]

void ultralight::Matrix::Rotate ( double  theta)

Rotate matrix by theta (in degrees)

◆ Rotate() [2/2]

void ultralight::Matrix::Rotate ( double  x,
double  y 
)

Rotate matrix by x and y.

◆ Scale()

void ultralight::Matrix::Scale ( double  x,
double  y 
)

Scale by x and y.

◆ Set() [1/4]

void ultralight::Matrix::Set ( const Matrix other)

Set to another matrix.

◆ Set() [2/4]

void ultralight::Matrix::Set ( const Matrix4x4 other)

Set to another matrix.

◆ Set() [3/4]

void ultralight::Matrix::Set ( double  a,
double  b,
double  c,
double  d,
double  e,
double  f 
)

Set from raw affine members.

◆ Set() [4/4]

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.

◆ SetIdentity()

void ultralight::Matrix::SetIdentity ( )

Set to identity matrix.

◆ SetOrthographicProjection()

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).

◆ Transform()

void ultralight::Matrix::Transform ( const Matrix other)

Transform (multiply) by another Matrix.

◆ Translate()

void ultralight::Matrix::Translate ( double  x,
double  y 
)

Translate by x and y.

Member Data Documentation

◆ data

Aligned4x4 ultralight::Matrix::data

The documentation for this struct was generated from the following file: