rhodonite
    Preparing search index...

    Class AbstractMatrixAbstract

    Abstract base class for matrix implementations.

    This class provides a common interface and basic functionality for all matrix types in the system. It implements the IMatrix interface and serves as the foundation for concrete matrix classes like Matrix44, Matrix33, etc.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    _v: Float32Array = ...

    Internal Float32Array storage for matrix elements

    Accessors

    • get glslStrAsFloat(): string

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

      Returns string

      GLSL-formatted string for float values

      Error - Must be implemented by subclasses

    • get glslStrAsInt(): string

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

      Returns string

      GLSL-formatted string for integer values

      Error - Must be implemented by subclasses

    • 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 wgslStrAsFloat(): string

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

      Returns string

      WGSL-formatted string for float values

      Error - Must be implemented by subclasses

    • get wgslStrAsInt(): string

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

      Returns string

      WGSL-formatted string for integer values

      Error - Must be implemented by subclasses

    • 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

    Methods

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

      Parameters

      • _row_i: number
      • _column_i: number

      Returns number

      The matrix element value at the specified position

      Error when not implemented in derived classes

    • Flattens the matrix into a one-dimensional array.

      Returns number[]

      A flat array containing all matrix elements in row-major order

      Error when not implemented in derived classes

    • Checks if this matrix is a dummy (uninitialized) matrix.

      A matrix is considered dummy if its internal storage has zero length, indicating it hasn't been properly initialized with matrix data.

      Returns boolean

      True if the matrix is dummy/uninitialized, 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

    • Converts the matrix to an approximate string representation.

      This method is useful for displaying matrices with rounded values for better readability in debugging or logging scenarios.

      Returns string

      An approximate string representation of the matrix

      Error when not implemented in derived classes

    • 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