• Composes a 4x4 matrix from position, quaternion, and scale. This matrix transformation is applied in the order of rotation -> scale -> translation.

    Parameters

    • position: Vec3

      The position vector to translate by.

    • quaternion: Quat

      The quaternion representing rotation.

    • scale: Vec3

      The scaling factor for each axis.

    • mat: Mat4 = ...

      An optional pre-allocated matrix for the result. Defaults to an identity matrix.

    Returns Mat4

    The resulting composed matrix.