Matrix4Ext extension

Extension methods on Flutter's Matrix4 that simplify common 3-D operations needed by the widget layer.

All factory helpers return a fresh Matrix4; none of the extension methods mutate the receiver unless the name ends with Set.

on

Properties

translationVec3 Vec3

Available on Matrix4, provided by the Matrix4Ext extension

Extracts the translation component.
no setter

Methods

applyPerspective([double depth = 800]) → void

Available on Matrix4, provided by the Matrix4Ext extension

Applies the perspective entry in-place.
withPerspective([double depth = 800]) Matrix4

Available on Matrix4, provided by the Matrix4Ext extension

Adds a perspective entry so Flutter's Transform widget renders depth.

Static Methods

perspective({double fovYRadians = math.pi / 4, double aspectRatio = 1.0, double near = 0.1, double far = 1000.0}) Matrix4

Available on Matrix4, provided by the Matrix4Ext extension

Returns a perspective-projection matrix.
rotation(Quat q) Matrix4

Available on Matrix4, provided by the Matrix4Ext extension

Returns a rotation matrix from a Quat.
scaleVec(Vec3 s) Matrix4

Available on Matrix4, provided by the Matrix4Ext extension

Returns a scale matrix.
translation(Vec3 v) Matrix4

Available on Matrix4, provided by the Matrix4Ext extension

Returns a translation matrix.
trs(Vec3 t, Quat r, Vec3 s) Matrix4

Available on Matrix4, provided by the Matrix4Ext extension

Builds a TRS (Translation × Rotation × Scale) matrix.