rhodonite
    Preparing search index...

    Class Matrix33

    Immutable 3x3 matrix with 32-bit float components. This is the standard precision implementation for normal matrices and other 3D math.

    Hierarchy (View Summary)

    Index
    _v: TypedArray = ...

    Internal typed array storage for matrix elements (Float32Array or Float64Array)

    • get className(): string

      Gets the class name.

      Returns string

      The string "Matrix33"

    • get glslStrAsFloat(): string

      Gets the matrix as a GLSL mat3 string with float precision.

      Returns string

      GLSL mat3 constructor string

    • get glslStrAsInt(): string

      Gets the matrix as a GLSL mat3 string with integer values.

      Returns string

      GLSL mat3 constructor string with floored values

    • get glslStrAsUint(): string

      Gets the GLSL string representation of the matrix as unsigned integer values.

      Returns string

      GLSL-formatted string for unsigned integer values with 'u' suffix

      Error - Must be implemented by subclasses

    • get isIdentityMatrixClass(): boolean

      Indicates whether this matrix is an identity matrix class.

      This property should be overridden in derived classes that represent identity matrices to return true.

      Returns boolean

      False for the base AbstractMatrix class

    • get m00(): number

      Gets the matrix element at row 0, column 0.

      Returns number

      The m00 component

    • get m01(): number

      Gets the matrix element at row 0, column 1.

      Returns number

      The m01 component

    • get m02(): number

      Gets the matrix element at row 0, column 2.

      Returns number

      The m02 component

    • get m10(): number

      Gets the matrix element at row 1, column 0.

      Returns number

      The m10 component

    • get m11(): number

      Gets the matrix element at row 1, column 1.

      Returns number

      The m11 component

    • get m12(): number

      Gets the matrix element at row 1, column 2.

      Returns number

      The m12 component

    • get m20(): number

      Gets the matrix element at row 2, column 0.

      Returns number

      The m20 component

    • get m21(): number

      Gets the matrix element at row 2, column 1.

      Returns number

      The m21 component

    • get m22(): number

      Gets the matrix element at row 2, column 2.

      Returns number

      The m22 component

    • get wgslStrAsFloat(): string

      Gets the matrix as a WGSL mat3x3f string with float precision.

      Returns string

      WGSL mat3x3f constructor string

    • get wgslStrAsInt(): string

      Gets the matrix as a WGSL mat3x3i string with integer values.

      Returns string

      WGSL mat3x3i constructor string with floored values

    • get wgslStrAsUint(): string

      Gets the WGSL string representation of the matrix as unsigned integer values.

      Returns string

      WGSL-formatted string for unsigned integer values with 'u' suffix

      Error - Must be implemented by subclasses

    • get compositionType(): CompositionTypeClass<"MAT3">

      Gets the composition type for this matrix.

      Returns CompositionTypeClass<"MAT3">

      CompositionType.Mat3

    • Gets the matrix element at the specified row and column.

      Parameters

      • row_i: number

        The row index (0-2)

      • column_i: number

        The column index (0-2)

      Returns number

      The matrix element at the specified position

    • Creates a deep copy of this matrix.

      Returns any

      A new Matrix33 instance with the same values

    • Calculates the determinant of this matrix.

      Returns number

      The determinant value

    • Converts the matrix to a flat array in column-major order.

      Returns number[]

      An array containing all 9 matrix elements

    • Extracts the scale factors from this matrix.

      Returns Vector3

      A new Vector3 containing the scale factors for each axis

    • Checks if this matrix is a dummy matrix (empty data array).

      Returns boolean

      True if the matrix has no data, false otherwise

    • Checks if this matrix is approximately equal to another matrix.

      Parameters

      • mat: IMatrix33

        The matrix to compare with

      • delta: number = Number.EPSILON

        The tolerance for comparison (default: Number.EPSILON)

      Returns boolean

      True if matrices are approximately equal, false otherwise

    • Checks if this matrix is strictly equal to another matrix.

      Parameters

      • mat: Matrix33

        The matrix to compare with

      Returns boolean

      True if all elements are exactly equal, false otherwise

    • Checks if the matrix's internal storage shares the same ArrayBuffer as the provided one.

      This method is useful for determining if two matrices share the same underlying memory, which can be important for performance optimizations and avoiding unnecessary data copying.

      Parameters

      • arrayBuffer: ArrayBuffer

        The ArrayBuffer to compare against

      Returns boolean

      True if the internal storage uses the same ArrayBuffer, false otherwise

    • Multiplies this matrix with a vector.

      Parameters

      Returns any

      A new vector representing the result of matrix * vector

    • Converts the matrix to a human-readable string representation.

      Returns string

      A formatted string showing the matrix in 3x3 layout

    • Converts the matrix to a human-readable string with rounded values.

      Returns string

      A formatted string showing the matrix with financially rounded values

    • Gets the matrix element at the specified index in the internal array.

      Parameters

      • i: number

        The index (0-8)

      Returns number

      The matrix element at the specified index

    • Creates a Matrix33 from 9 values in column-major order.

      Parameters

      • m00: number

        Element at row 0, column 0

      • m10: number

        Element at row 1, column 0

      • m20: number

        Element at row 2, column 0

      • m01: number

        Element at row 0, column 1

      • m11: number

        Element at row 1, column 1

      • m21: number

        Element at row 2, column 1

      • m02: number

        Element at row 0, column 2

      • m12: number

        Element at row 1, column 2

      • m22: number

        Element at row 2, column 2

      • type: FloatTypedArrayConstructor

      Returns IMatrix33

      A new Matrix33 instance

    • Creates a Matrix33 from 9 values in row-major order. Values are stored internally in column-major order for WebGL compatibility.

      Parameters

      • m00: number

        Element at row 0, column 0

      • m01: number

        Element at row 0, column 1

      • m02: number

        Element at row 0, column 2

      • m10: number

        Element at row 1, column 0

      • m11: number

        Element at row 1, column 1

      • m12: number

        Element at row 1, column 2

      • m20: number

        Element at row 2, column 0

      • m21: number

        Element at row 2, column 1

      • m22: number

        Element at row 2, column 2

      • type: FloatTypedArrayConstructor

      Returns IMatrix33

      A new Matrix33 instance

    • Calculates the inverse of the given matrix and stores the result in the output matrix.

      If the matrix is numerically singular, the output matrix is set to the identity matrix instead of being filled with Infinity/NaN. Use Matrix33.tryInvertTo when the caller needs to detect the failure.

      Parameters

      Returns IMutableMatrix33

      The output matrix containing the inverted matrix, or the identity matrix if the input is singular

    • Creates a rotation matrix from Euler angles in XYZ order.

      Parameters

      • x: number

        Rotation around X-axis in radians

      • y: number

        Rotation around Y-axis in radians

      • z: number

        Rotation around Z-axis in radians

      • type: FloatTypedArrayConstructor

      Returns IMatrix33

      A new rotation matrix representing the combined rotations

    • Attempts to calculate the inverse of the given matrix and stores the result in the output matrix. The output matrix is left untouched when the input is numerically singular.

      Parameters

      Returns boolean

      True if the inversion succeeded, false if the matrix is singular

    • Creates a dummy matrix with an empty array.

      Returns Matrix33

    • Creates a matrix from column-major components.

      Parameters

      • m00: number
      • m10: number
      • m20: number
      • m01: number
      • m11: number
      • m21: number
      • m02: number
      • m12: number
      • m22: number

      Returns Matrix33

    • Creates a matrix from row-major components.

      Parameters

      • m00: number
      • m01: number
      • m02: number
      • m10: number
      • m11: number
      • m12: number
      • m20: number
      • m21: number
      • m22: number

      Returns Matrix33

    • Creates a matrix from a 9-element array in column-major order.

      Parameters

      Returns Matrix33

    • Creates a matrix from a 9-element array in row-major order.

      Parameters

      Returns Matrix33

    • Creates a matrix from an array in column-major order.

      Parameters

      • array: number[]

      Returns Matrix33

    • Creates a matrix from an array in row-major order.

      Parameters

      • array: number[]

      Returns Matrix33

    • Creates a matrix by copying a Float32Array in column-major order.

      Parameters

      • array: Float32Array

      Returns Matrix33

    • Creates a matrix by copying a Float32Array in row-major order.

      Parameters

      • array: Float32Array

      Returns Matrix33

    • Creates a matrix by copying another matrix.

      Parameters

      Returns Matrix33

    • Creates a matrix from the upper-left 3x3 portion of a 4x4 matrix.

      Parameters

      Returns Matrix33

    • Creates a matrix from a quaternion representing a rotation.

      Parameters

      Returns Matrix33

    • Creates a matrix that directly uses the given Float32Array.

      Parameters

      • array: Float32Array

      Returns Matrix33

    • Creates an identity matrix (optimized IdentityMatrix33 instance).

      Returns IMatrix33

    • Creates the inverse of the given matrix (identity when singular).

      Parameters

      Returns Matrix33

    • Creates a rotation matrix from a Vector3 containing Euler angles.

      Parameters

      Returns Matrix33

    • Creates a rotation matrix around the X-axis.

      Parameters

      • radian: number

      Returns Matrix33

    • Creates a rotation matrix from Euler angles in XYZ order.

      Parameters

      • x: number
      • y: number
      • z: number

      Returns Matrix33

    • Creates a rotation matrix around the Y-axis.

      Parameters

      • radian: number

      Returns Matrix33

    • Creates a rotation matrix around the Z-axis.

      Parameters

      • radian: number

      Returns Matrix33

    • Attempts to invert the given matrix, returning null when it is singular.

      Parameters

      Returns Matrix33 | null

    • Creates a zero matrix.

      Returns Matrix33