Excalibur Matrix helper for 4x4 matrices

Useful for webgl 4x4 matrices

Hierarchy

  • Matrix

Constructors

Properties

data: Float32Array = ...

4x4 matrix in column major order

data[0] data[4] data[8] data[12]
data[1] data[5] data[9] data[13]
data[2] data[6] data[10] data[14]
data[3] data[7] data[11] data[15]

Methods

  • Return the affine inverse, optionally store it in a target matrix.

    It's recommended you call .reset() the target unless you know what you're doing

    Parameters

    Returns Matrix

  • Determinant of the upper left 2x2 matrix

    Returns number

  • Resets the current matrix to the identity matrix, mutating it

    Returns

    Current matrix as identity

    Returns Matrix

  • Applies rotation to the current matrix mutating it

    Parameters

    • angle: number

      in Radians

    Returns Matrix

  • Applies scaling to the current matrix mutating it

    Parameters

    • x: number
    • y: number

    Returns Matrix

  • Parameters

    • x: number
    • y: number

    Returns void

  • Parameters

    • angle: number

    Returns void

  • Parameters

    • val: number

    Returns void

  • Parameters

    • val: number

    Returns void

  • Converts the current matrix into a DOMMatrix

    This is useful when working with the browser Canvas context

    Returns

    DOMMatrix

    Returns DOMMatrix

  • Applies translation to the current matrix mutating it

    Parameters

    • x: number
    • y: number

    Returns Matrix

  • Creates a brand new rotation matrix with the specified angle

    Parameters

    • angleRadians: number

    Returns Matrix

  • Creates a brand new scaling matrix with the specified scaling factor

    Parameters

    • sx: number
    • sy: number

    Returns Matrix

  • Creates a brand new translation matrix at the specified 3d point

    Parameters

    • x: number
    • y: number

    Returns Matrix