PokéRogue
    Preparing search index...

    A 3x3 column-major matrix stored as a Float32Array of 9 values. Used for 2D affine transformations, extracting the upper-left 3x3 portion of a Matrix4, and computing normal matrices for lighting calculations. Values are stored in column-major order to match WebGL conventions.

    Defaults to the identity matrix when instantiated.

    Index
    • Parameters

      • Optionalm: Matrix3

        Optional Matrix3 to copy values from.

      Returns Matrix3

    The matrix values.

    • Calculate the adjoint, or adjugate, of this Matrix.undefined

      Returns Matrix3

      This Matrix3.

    • Make a clone of this Matrix3.undefined

      Returns Matrix3

      A clone of this Matrix3.

    • Copy the values of a given Matrix into this Matrix.

      Parameters

      • src: Matrix3

        The Matrix to copy the values from.

      Returns Matrix3

      This Matrix3.

    • Calculate the determinant of this Matrix.undefined

      Returns number

      The determinant of this Matrix.

    • Set the values of this Matrix from the given array.

      Parameters

      • a: any[]

        The array to copy the values from.

      Returns Matrix3

      This Matrix3.

    • Copies the upper-left 3x3 values of a Matrix4 into this Matrix3, discarding the fourth row and column. This is useful when you need the rotation and scale portion of a transformation matrix without its translation component.

      Parameters

      • m: Matrix4

        The Matrix4 to copy the values from.

      Returns Matrix3

      This Matrix3.

    • Set the values of this Matrix from the given Quaternion.

      Parameters

      • q: Quaternion

        The Quaternion to set the values of this Matrix from.

      Returns Matrix3

      This Matrix3.

    • Reset this Matrix to an identity (default) matrix.undefined

      Returns Matrix3

      This Matrix3.

    • Invert this Matrix. Returns null if the matrix is not invertible (i.e. its determinant is zero).undefined

      Returns Matrix3

      This Matrix3, or null if the matrix cannot be inverted.

    • Multiply this Matrix by the given Matrix.

      Parameters

      • src: Matrix3

        The Matrix to multiply this Matrix by.

      Returns Matrix3

      This Matrix3.

    • Derives a normal matrix from the given Matrix4. The normal matrix is the transpose of the inverse of the Matrix4, and is used in lighting calculations to correctly transform surface normals when non-uniform scaling is applied. Returns null if the Matrix4 is not invertible (i.e. its determinant is zero).

      Parameters

      • m: Matrix4

        The Matrix4 to derive the normal matrix from.

      Returns Matrix3

      This Matrix3, or null if the Matrix4 cannot be inverted.

    • Apply a rotation transformation to this Matrix.

      Parameters

      • rad: number

        The angle in radians to rotate by.

      Returns Matrix3

      This Matrix3.

    • Apply a scale transformation to this Matrix.

      Uses the x and y components of the given Vector to scale the Matrix.

      Parameters

      Returns Matrix3

      This Matrix3.

    • This method is an alias for Matrix3.copy.

      Parameters

      • src: Matrix3

        The Matrix to set the values of this Matrix from.

      Returns Matrix3

      This Matrix3.

    • Translate this Matrix using the given Vector.

      Parameters

      Returns Matrix3

      This Matrix3.

    • Transpose this Matrix.undefined

      Returns Matrix3

      This Matrix3.