Selva Compute API Reference - v1.1.2
    Preparing search index...
    Index

    Constructors

    • Creates an identity matrix.

      Returns Matrix3

    • Creates a 3x3 matrix with the given arguments in row-major order.

      Parameters

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

      Returns Matrix3

    Properties

    elements: Matrix3Tuple

    Array with matrix values.

    [1, 0, 0, 0, 1, 0, 0, 0, 1]
    
    isMatrix3: true

    Methods

    • Returns this

    • Parameters

      Returns this

    • Returns number

    • Parameters

      Returns boolean

    • Parameters

      Returns this

    • Sets the values of this matrix from the provided array or array-like.

      Parameters

      • array: ArrayLike<number>

        the source array or array-like.

      • Optionaloffset: number

        (optional) offset into the array-like. Default is 0.

      Returns this

    • Parameters

      Returns this

    • Returns this

    • Inverts this matrix in place.

      Returns this

    • Sets this matrix as a 2D rotational transformation by theta radians. The resulting matrix will be:

      cos(θ) -sin(θ) 0
      sin(θ) cos(θ) 0
      0 0 1

      Parameters

      • theta: number

        Rotation angle in radians. Positive values rotate counterclockwise.

      Returns this

    • Sets this matrix as a 2D scale transform:

      x, 0, 0,
      0, y, 0,
      0, 0, 1

      Parameters

      • x: number

        the amount to scale in the X axis.

      • y: number

        the amount to scale in the Y axis.

      Returns this

    • Sets this matrix as a 2D translation transform:

      1, 0, x,
      0, 1, y,
      0, 0, 1

      Parameters

      • v: Vector2

        the amount to translate.

      Returns this

    • Sets this matrix as a 2D translation transform:

      1, 0, x,
      0, 1, y,
      0, 0, 1

      Parameters

      • x: number

        the amount to translate in the X axis.

      • y: number

        the amount to translate in the Y axis.

      Returns this

    • Multiplies this matrix by m.

      Parameters

      Returns this

    • Sets this matrix to a x b.

      Parameters

      Returns this

    • Parameters

      • s: number

      Returns this

    • Parameters

      Returns this

    • Parameters

      • theta: number

      Returns this

    • Parameters

      • sx: number
      • sy: number

      Returns this

    • Parameters

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

      Returns Matrix3

    • Parameters

      Returns Matrix3

    • Parameters

      • tx: number
      • ty: number
      • sx: number
      • sy: number
      • rotation: number
      • cx: number
      • cy: number

      Returns this

    • Writes the elements of this matrix to an array in column-major format.

      Returns Matrix3Tuple

    • Writes the elements of this matrix to an array in column-major format.

      Type Parameters

      Parameters

      • array: TArray

        array to store the resulting vector in. If not given a new array will be created.

      • Optionaloffset: number

        (optional) offset in the array at which to put the result.

      Returns TArray

    • Parameters

      • tx: number
      • ty: number

      Returns this

    • Transposes this matrix in place.

      Returns this

    • Transposes this matrix into the supplied array r, and returns itself.

      Parameters

      • r: number[]

      Returns this