![]() |
Flutter Engine
The Flutter Engine
|
A 4x4 matrix using column-major storage. More...
#include <matrix.h>
Public Member Functions | |
constexpr | Matrix () |
constexpr | Matrix (Scalar m0, Scalar m1, Scalar m2, Scalar m3, Scalar m4, Scalar m5, Scalar m6, Scalar m7, Scalar m8, Scalar m9, Scalar m10, Scalar m11, Scalar m12, Scalar m13, Scalar m14, Scalar m15) |
Matrix (const MatrixDecomposition &decomposition) | |
constexpr Matrix | Basis () const |
The Matrix without its w components (without translation). More... | |
constexpr Matrix | Translate (const Vector3 &t) const |
constexpr Matrix | Scale (const Vector3 &s) const |
constexpr Matrix | Multiply (const Matrix &o) const |
constexpr Matrix | Transpose () const |
Matrix | Invert () const |
Scalar | GetDeterminant () const |
Scalar | GetMaxBasisLength () const |
constexpr Scalar | GetMaxBasisLengthXY () const |
constexpr Vector3 | GetBasisX () const |
constexpr Vector3 | GetBasisY () const |
constexpr Vector3 | GetBasisZ () const |
constexpr Vector3 | GetScale () const |
constexpr Scalar | GetDirectionScale (Vector3 direction) const |
constexpr bool | IsAffine () const |
constexpr bool | HasPerspective2D () const |
constexpr bool | HasPerspective () const |
constexpr bool | HasTranslation () const |
constexpr bool | IsAligned2D (Scalar tolerance=0) const |
constexpr bool | IsAligned (Scalar tolerance=0) const |
constexpr bool | IsIdentity () const |
constexpr bool | IsTranslationScaleOnly () const |
Returns true if the matrix has a scale-only basis and is non-projective. Note that an identity matrix meets this criteria. More... | |
std::optional< MatrixDecomposition > | Decompose () const |
constexpr bool | operator== (const Matrix &m) const |
constexpr bool | operator!= (const Matrix &m) const |
Matrix | operator+ (const Vector3 &t) const |
Matrix | operator- (const Vector3 &t) const |
Matrix | operator* (const Matrix &m) const |
Matrix | operator+ (const Matrix &m) const |
constexpr Vector4 | operator* (const Vector4 &v) const |
constexpr Vector3 | operator* (const Vector3 &v) const |
constexpr Point | operator* (const Point &v) const |
constexpr Vector3 | TransformHomogenous (const Point &v) const |
constexpr Vector4 | TransformDirection (const Vector4 &v) const |
constexpr Vector3 | TransformDirection (const Vector3 &v) const |
constexpr Vector2 | TransformDirection (const Vector2 &v) const |
constexpr Quad | Transform (const Quad &quad) const |
Static Public Member Functions | |
static constexpr Matrix | MakeColumn (Scalar m0, Scalar m1, Scalar m2, Scalar m3, Scalar m4, Scalar m5, Scalar m6, Scalar m7, Scalar m8, Scalar m9, Scalar m10, Scalar m11, Scalar m12, Scalar m13, Scalar m14, Scalar m15) |
static constexpr Matrix | MakeRow (Scalar m0, Scalar m1, Scalar m2, Scalar m3, Scalar m4, Scalar m5, Scalar m6, Scalar m7, Scalar m8, Scalar m9, Scalar m10, Scalar m11, Scalar m12, Scalar m13, Scalar m14, Scalar m15) |
static constexpr Matrix | MakeTranslation (const Vector3 &t) |
static constexpr Matrix | MakeScale (const Vector3 &s) |
static constexpr Matrix | MakeScale (const Vector2 &s) |
static constexpr Matrix | MakeSkew (Scalar sx, Scalar sy) |
static Matrix | MakeRotation (Quaternion q) |
static Matrix | MakeRotation (Radians radians, const Vector4 &r) |
static Matrix | MakeRotationX (Radians r) |
static Matrix | MakeRotationY (Radians r) |
static Matrix | MakeRotationZ (Radians r) |
template<class T > | |
static constexpr Matrix | MakeOrthographic (TSize< T > size) |
static constexpr Matrix | MakePerspective (Radians fov_y, Scalar aspect_ratio, Scalar z_near, Scalar z_far) |
template<class T > | |
static constexpr Matrix | MakePerspective (Radians fov_y, TSize< T > size, Scalar z_near, Scalar z_far) |
static constexpr Matrix | MakeLookAt (Vector3 position, Vector3 target, Vector3 up) |
Public Attributes | |
union { | |
Scalar m [16] | |
Scalar e [4][4] | |
Vector4 vec [4] | |
}; | |
A 4x4 matrix using column-major storage.
Utility methods that need to make assumptions about normalized device coordinates must use the following convention: * Left-handed coordinate system. Positive rotation is clockwise about axis of rotation. * Lower left corner is -1.0f, -1.0. * Upper right corner is 1.0f, 1.0. * Visible z-space is from 0.0 to 1.0. * This is NOT the same as OpenGL! Be careful. * NDC origin is at (0.0f, 0.0f, 0.5f).
|
inlineconstexpr |
|
explicit |
Definition at line 12 of file matrix.cc.
|
inlineconstexpr |
The Matrix without its w
components (without translation).
std::optional< MatrixDecomposition > impeller::Matrix::Decompose | ( | ) | const |
Definition at line 209 of file matrix.cc.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Scalar impeller::Matrix::GetDeterminant | ( | ) | const |
Definition at line 162 of file matrix.cc.
Definition at line 316 of file matrix.h.
Scalar impeller::Matrix::GetMaxBasisLength | ( | ) | const |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Matrix impeller::Matrix::Invert | ( | ) | const |
Definition at line 97 of file matrix.cc.
|
inlineconstexpr |
|
inlineconstexpr |
Definition at line 351 of file matrix.h.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Returns true if the matrix has a scale-only basis and is non-projective. Note that an identity matrix meets this criteria.
|
inlinestaticconstexpr |
Definition at line 532 of file matrix.h.
|
inlinestaticconstexpr |
Definition at line 497 of file matrix.h.
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
Definition at line 524 of file matrix.h.
|
inlinestatic |
Definition at line 126 of file matrix.h.
Definition at line 151 of file matrix.h.
|
inlineconstexpr |
Definition at line 423 of file matrix.h.
|
inlineconstexpr |
|
inlineconstexpr |
union { ... } impeller::Matrix::@29 |