rhodonite
    Preparing search index...

    Class IdentityMatrix33

    A 3x3 identity matrix implementation that represents the multiplicative identity for 3x3 matrices. This matrix has 1s on the main diagonal and 0s elsewhere:

    [1 0 0]
    [0 1 0]
    [0 0 1]

    This class is optimized for identity matrix operations and provides constant-time access to matrix elements without storing the actual matrix data.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    _v: Float32Array = ...

    Internal Float32Array storage for matrix elements

    __v: Float32Array<ArrayBuffer> = ...

    Shared Float32Array containing the identity matrix values [1,0,0,0,1,0,0,0,1]

    Accessors

    • get glslStrAsFloat(): string

      Gets the GLSL string representation of the identity matrix as float values.

      Returns string

      GLSL mat3 constructor string for identity matrix

    • get glslStrAsInt(): string

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

      Returns string

      GLSL mat3 constructor string for identity matrix

    • get glslStrAsUint(): string

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

      Returns string

      GLSL mat3 constructor string for identity matrix

    • get wgslStrAsFloat(): string

      Gets the WGSL string representation of the identity matrix as float values.

      Returns string

      WGSL mat3x3f constructor string for identity matrix

    • get wgslStrAsInt(): string

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

      Returns string

      WGSL mat3x3i constructor string for identity matrix

    • get wgslStrAsUint(): string

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

      Returns string

      WGSL mat3x3u constructor string for identity matrix

    Methods

    • Gets the matrix element at the specified row and column. For identity matrix: returns 1 if row equals column, 0 otherwise.

      Parameters

      • row_i: number

        The row index (0-2)

      • column_i: number

        The column index (0-2)

      Returns number

      The matrix element value

    • Checks if another matrix is approximately equal to this identity matrix within a tolerance.

      Parameters

      • mat: IMatrix33

        The matrix to compare against

      • delta: number = Number.EPSILON

        The tolerance for floating-point comparison (default: Number.EPSILON)

      Returns boolean

      True if the matrix is approximately an identity matrix

    • Checks if another matrix is strictly equal to this identity matrix (exact comparison). Note: This method appears to have a bug - it checks 16 elements instead of 9 for a 3x3 matrix.

      Parameters

      Returns boolean

      True if the matrix is exactly an identity matrix

    • 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

    • Gets the matrix element at the specified flat index.

      This provides direct access to the underlying Float32Array storage using a single index rather than row/column coordinates.

      Parameters

      • i: number

        The zero-based flat index into the matrix storage

      Returns number

      The matrix element value at the specified index