magic-pixels
    Preparing search index...

    Class Mat3

    A 3x3 matrix of 32-bit floats in column-major order. All operations work in place and return this.

    Hierarchy

    • Float32Matrix
      • Mat3
    Index
    • Parameters

      • Optionalvalues: ArrayLike<number>

        9 values in column-major order; identity if omitted

      Returns Mat3

    dimension: 3

    number of rows (= number of columns)

    values: Float32Array

    the values in column-major order

    • Copy the values of another matrix of the same size into this one

      Parameters

      • other: this

      Returns this

    • exact element-wise equality

      Parameters

      • other: this

      Returns boolean

    • Reset to the identity matrix

      Returns this

    • Invert in place. A singular matrix becomes the zero matrix.

      Returns this

    • true if all values are finite (neither NaN nor Infinity)

      Returns boolean

    • element-wise equality within a tolerance

      Parameters

      • other: this
      • delta: number = 1e-6

        tolerance, 1e-6 by default (the values are 32-bit floats)

      Returns boolean

    • Overwrite all values.

      Parameters

      • values: ArrayLike<number>

        dimension² values in column-major order

      Returns this

    • Set this to the normal matrix of a model(-view) matrix: the inverse transpose of its upper-left 3x3 part. Transforms normals correctly even when the model matrix contains non-uniform scaling.

      Parameters

      Returns this

    • Parameters

      • angle: number

      Returns this

    • Parameters

      • angle: number

      Returns this

    • Parameters

      • angle: number

      Returns this

    • Parameters

      • sx: number
      • sy: number
      • sz: number

      Returns this

    • Parameters

      • x: number
      • y: number

      Returns this

    • the values as a plain array, column-major

      Returns number[]

    • value at a given position

      Parameters

      • row: number

        row index starting from 0

      • column: number

        column index starting from 0

      Returns number

    • create X-rotation matrix

      Parameters

      • angle: number

        rotation in radians

      Returns Mat3

    • create Y-rotation matrix

      Parameters

      • angle: number

        angle in radians

      Returns Mat3

    • create Z-rotation matrix

      Parameters

      • angle: number

        angle in radians

      Returns Mat3

    • create scaling matrix

      Parameters

      • sx: number

        scale X factor

      • sy: number

        scale Y factor

      • sz: number

        scale Z factor

      Returns Mat3

    • create 2D translation matrix

      Parameters

      • x: number

        translation in x-direction

      • y: number

        translation in y-direction

      Returns Mat3