Skip to content

Matrix4

A recorded, replayable Matrix4 transform intent.

This class records constructors and mutating method calls, then Flet replays them in Flutter to build a real Matrix4 for Transform.matrix.

Properties

  • ctor(_Matrix4Call) –

    Recorded constructor call.

  • ops(list[_Matrix4Call]) –

    Ordered list of recorded mutating operations.

Methods

  • diagonal3_values

    Creates a matrix initialized with diagonal scale values.

  • identity

    Creates a matrix initialized with identity transform.

  • multiply

    Appends multiplication by another recorded matrix.

  • rotate_x

    Appends x-axis rotation operation in radians.

  • rotate_y

    Appends y-axis rotation operation in radians.

  • rotate_z

    Appends z-axis rotation operation in radians.

  • rotation_z

    Creates a matrix initialized with a z-axis rotation in radians.

  • scale

    Appends scale operation.

  • set_entry

    Appends raw matrix entry mutation.

  • skew_x

    Creates a matrix initialized with x-axis skew in radians.

  • skew_y

    Creates a matrix initialized with y-axis skew in radians.

  • translate

    Appends translation operation.

  • translation_values

    Creates a matrix initialized with translation components.

Properties#

ctor class-attribute instance-attribute #

ctor: _Matrix4Call = field(
    default_factory=lambda: _Matrix4Call(name="identity")
)

Recorded constructor call.

ops class-attribute instance-attribute #

ops: list[_Matrix4Call] = field(default_factory=list)

Ordered list of recorded mutating operations.

Methods#

diagonal3_values classmethod #

diagonal3_values(
    x: Number, y: Number, z: Number
) -> Matrix4

Creates a matrix initialized with diagonal scale values.

identity classmethod #

identity() -> Matrix4

Creates a matrix initialized with identity transform.

multiply #

multiply(other: Matrix4) -> Matrix4

Appends multiplication by another recorded matrix.

rotate_x #

rotate_x(angle: Number) -> Matrix4

Appends x-axis rotation operation in radians.

rotate_y #

rotate_y(angle: Number) -> Matrix4

Appends y-axis rotation operation in radians.

rotate_z #

rotate_z(angle: Number) -> Matrix4

Appends z-axis rotation operation in radians.

rotation_z classmethod #

rotation_z(angle: Number) -> Matrix4

Creates a matrix initialized with a z-axis rotation in radians.

scale #

scale(
    x: Number,
    y: Number | None = None,
    z: Number | None = None,
) -> Matrix4

Appends scale operation.

If only x is provided then uniform scale is used. If x and y are provided then 2D scale is used. If all three are provided then 3D scale is used.

set_entry #

set_entry(row: int, col: int, value: Number) -> Matrix4

Appends raw matrix entry mutation.

skew_x classmethod #

skew_x(angle: Number) -> Matrix4

Creates a matrix initialized with x-axis skew in radians.

skew_y classmethod #

skew_y(angle: Number) -> Matrix4

Creates a matrix initialized with y-axis skew in radians.

translate #

translate(x: Number, y: Number, z: Number = 0) -> Matrix4

Appends translation operation.

translation_values classmethod #

translation_values(
    x: Number, y: Number, z: Number
) -> Matrix4

Creates a matrix initialized with translation components.