Matrix class

Matrix, 4x4 components, column major, OpenGL style, right-handed

Inheritance

Constructors

Matrix({StructPointer<Matrix>? op, double m0 = 0, double m1 = 0, double m2 = 0, double m3 = 0, double m4 = 0, double m5 = 0, double m6 = 0, double m7 = 0, double m8 = 0, double m9 = 0, double m10 = 0, double m11 = 0, double m12 = 0, double m13 = 0, double m14 = 0, double m15 = 0})
Matrix.compose(Vector3 translation, Quaternion rotation, Vector3 scale)
Returns a transformation matrix composed of a rotational, translational and scaling components.
factory
Matrix.fromQuaternion(Quaternion q)
Returns the rotation matrix equivalent of quaternion q.
factory
Matrix.frustum(double left, double right, double bottom, double top, double nearPlane, double farPlane)
Returns a perspective projection matrix defined by the given frustum planes.
factory
Matrix.identity()
Returns the 4x4 identity matrix.
factory
Matrix.lookAt(Vector3 eye, Vector3 target, Vector3 up)
Returns a view matrix oriented from eye toward target, with up defining the vertical axis.
factory
Matrix.mat4(num m0, num m1, num m2, num m3, num m4, num m5, num m6, num m7, num m8, num m9, num m10, num m11, num m12, num m13, num m14, num m15)
factory
Matrix.mat4RowMajor(num m0, num m4, num m8, num m12, num m1, num m5, num m9, num m13, num m2, num m6, num m10, num m14, num m3, num m7, num m11, num m15)
factory
Matrix.ortho(double left, double right, double bottom, double top, double nearPlane, double farPlane)
Returns an orthographic projection matrix defined by the given clip planes.
factory
Matrix.perspective(double fovY, double aspect, double nearPlane, double farPlane)
Returns a perspective projection matrix from a vertical FOV fovY (in radians), aspect ratio, and clip planes.
factory
Matrix.rotateAngle(Vector3 axis, double angle)
Returns a rotation matrix around axis by angle radians.
factory
Matrix.rotateX(double angle)
Returns a rotation matrix around the X axis by angle radians.
factory
Matrix.rotateXYZ(Vector3 angle)
Returns a rotation matrix applied in X > Y > Z order from angle's components (in radians).
factory
Matrix.rotateY(double angle)
Returns a rotation matrix around the Y axis by angle radians.
factory
Matrix.rotateZ(double angle)
Returns a rotation matrix around the Z axis by angle radians.
factory
Matrix.rotateZYX(Vector3 angle)
Returns a rotation matrix applied in Z > Y > X order from angle's components (in radians).
factory
Matrix.scale(double x, double y, double z)
Returns a scaling matrix for the given x, y, z factors.
factory
Matrix.translate(num x, num y, num z)
Returns a translation matrix for the given x, y, z offsets.
factory
Matrix.translateVector3(Vector3 v)
Returns a translation matrix from v's components. Convenience wrapper for translate.
factory
Matrix.zero()
factory

Properties

$state → RaylibTempStructState
Per-instance allocation state tracking slot keys, disposal, and identity.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
m0 ↔ double
Column 0, row 0
getter/setter pair
m1 ↔ double
Column 0, row 1
getter/setter pair
m10 ↔ double
Column 2, row 2
getter/setter pair
m11 ↔ double
Column 2, row 3
getter/setter pair
m12 ↔ double
Column 3, row 0 (translation X)
getter/setter pair
m13 ↔ double
Column 3, row 1 (translation Y)
getter/setter pair
m14 ↔ double
Column 3, row 2 (translation Z)
getter/setter pair
m15 ↔ double
Column 3, row 3
getter/setter pair
m2 ↔ double
Column 0, row 2
getter/setter pair
m3 ↔ double
Column 0, row 3
getter/setter pair
m4 ↔ double
Column 1, row 0
getter/setter pair
m5 ↔ double
Column 1, row 1
getter/setter pair
m6 ↔ double
Column 1, row 2
getter/setter pair
m7 ↔ double
Column 1, row 3
getter/setter pair
m8 ↔ double
Column 2, row 0
getter/setter pair
m9 ↔ double
Column 2, row 1
getter/setter pair
op ↔ StructPointer<Matrix>?
The C-owned or RaylibTemp-owned typed pointer for this struct, if any.
getter/setter pairinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
structName → String
The Dart-side type name of this struct
no setterinherited

Methods

add(Matrix o) → Matrix
Returns a new matrix that is the component-wise sum of this and o.
clone() → Matrix
Returns a deep copy of this instance, preserving op if present.
override
copy() → Matrix
Returns a deep copy of this instance without op.
inherited
decompose() → (Vector3, Quaternion, Vector3)
Decomposes this matrix into its translation, rotation, and scale components.
determinant() → double
Returns the determinant of this matrix.
format([int x0 = 0]) → String
Returns a formatted 4x4 matrix string with each row on its own line.
getOp() → StructPointer<Matrix>
Returns op, throwing a descriptive StateError if unavailable or this instance RaylibTempStructState.isDisposed.
inherited
getOpAndDispose() → StructPointer<Matrix>
Returns op and immediately disposes this struct.
inherited
invert() → Matrix
Returns a new matrix that is the inverse of this one.
mul(Matrix o) → Matrix
Returns a new matrix that is the product of this and o.
mulValue(double value) → Matrix
Returns a new matrix with components multiplied by value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set(num m0, num m1, num m2, num m3, num m4, num m5, num m6, num m7, num m8, num m9, num m10, num m11, num m12, num m13, num m14, num m15) → Matrix
Sets all components in column-major order at once.
setDart(Matrix o) → Matrix
Copies the fields of o into this instance.
override
signature() → String
Returns a human-readable representation of this struct.
override
structAllocateInto(RaylibTemp<RaylibBase> temp, MemoryPointer<RType> p, String key) → void
Allocates nested pointers into temp under key as needed.
inherited
structDispose() → void
Marks this instance as disposed.
inherited
structOnOp(void callback(StructPointer<Matrix> p)) → void
Calls callback with op if it is set, otherwise no-ops.
inherited
structReadFrom(MemoryPointer<RType> p) → void
override
structSetTag(String newTag) → Matrix
Sets RaylibTempStructState.tag to newTag.
inherited
structSyncFromMemory() → void
Syncs all fields from the memory. Requires op.
inherited
structSyncToMemory() → void
Syncs all fields to the memory. Requires op.
inherited
structWriteInto(MemoryPointer<RType> p) → void
override
sub(Matrix o) → Matrix
Returns a new matrix that is the component-wise difference of this and o.
toArray({bool rowMajorOrder = false}) → List<double>
Returns all 16 components as a flat list in column-major order by default.
toFloatV({bool rowMajorOrder = false}) → float16
Returns all 16 components as a float16 in column-major order by default.
toString() → String
A string representation of this object.
inherited
trace() → double
Returns the trace of this matrix (sum of diagonal elements: m0 + m5 + m10 + m15).
transpose() → Matrix
Returns a new matrix that is the transpose of this one.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

field_m0 → StructValueField<double, RFloat>
Field descriptor for m0.
final
field_m1 → StructValueField<double, RFloat>
Field descriptor for m1.
final
field_m10 → StructValueField<double, RFloat>
Field descriptor for m10.
final
field_m11 → StructValueField<double, RFloat>
Field descriptor for m11.
final
field_m12 → StructValueField<double, RFloat>
Field descriptor for m12.
final
field_m13 → StructValueField<double, RFloat>
Field descriptor for m13.
final
field_m14 → StructValueField<double, RFloat>
Field descriptor for m14.
final
field_m15 → StructValueField<double, RFloat>
Field descriptor for m15.
final
field_m2 → StructValueField<double, RFloat>
Field descriptor for m2.
final
field_m3 → StructValueField<double, RFloat>
Field descriptor for m3.
final
field_m4 → StructValueField<double, RFloat>
Field descriptor for m4.
final
field_m5 → StructValueField<double, RFloat>
Field descriptor for m5.
final
field_m6 → StructValueField<double, RFloat>
Field descriptor for m6.
final
field_m7 → StructValueField<double, RFloat>
Field descriptor for m7.
final
field_m8 → StructValueField<double, RFloat>
Field descriptor for m8.
final
field_m9 → StructValueField<double, RFloat>
Field descriptor for m9.
final
struct → StructType<Matrix>
Describes the raw memory layout, construction, and pointer representation of this struct type.
final
structLayout → StructLayout<MatrixField>
Raw memory layout of this object.
final