A 3x3 (square) matrix of numbers.

An adapter over a Float32Array, enabling it to be used directly with WebGL.

The 9 elements are stored in column-major order (the order expected by WebGL):

036
147
258

Hierarchy

Constructors

Properties

modified: boolean
one: Matrix3 = ...

The identity matrix for multiplication. The matrix is locked (immutable), but may be cloned.

zero: Matrix3 = ...

The identity matrix for addition. The matrix is locked (immutable), but may be cloned.

Accessors

Methods

  • Parameters

    • row: number

      The zero-based row.

    • column: number

      The zero-based column.

    Returns number

  • Determines whether this Lockable is locked. If the Lockable is in the unlocked state then it is mutable. If the Lockable is in the locked state then it is immutable.

    Returns boolean

  • Locks this Lockable (preventing any further mutation), and returns a token that may be used to unlock it.

    Returns number

  • Sets this 3x3 matrix to the matrix required to properly transform normal vectors (pseudo or axial vectors) based upon the 4x4 matrix used to transform polar vectors.

    Parameters

    Returns this

  • Sets this matrix to the transformation for a reflection in the plane normal to the unit vector n.

    this ⟼ reflection(n)

    Parameters

    Returns this

  • Sets all elements of this matrix to the supplied values (provided in row-major order).

    An advantage of this method is that the function call resembles the matrix written out.

    The parameters are named according to the 1-based row and column.

    Parameters

    • n11: number
    • n12: number
    • n13: number
    • n21: number
    • n22: number
    • n23: number
    • n31: number
    • n32: number
    • n33: number

    Returns this

  • Parameters

    • row: number

      The zero-based row.

    • column: number

      The zero-based column.

    • value: number

      The value of the element.

    Returns void

  • Unlocks this Lockable (allowing mutation), using a token that was obtained from a preceding lock method call.

    Parameters

    • token: number

    Returns void