Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Mat3

Mathematical 3x3 matrix.

Hierarchy

Index

Constructors

constructor

  • newMat3(other: Mat3): Mat3
  • newMat3(m00?: undefined | number, m01?: undefined | number, m02?: undefined | number, m03?: undefined | number, m04?: undefined | number, m05?: undefined | number, m06?: undefined | number, m07?: undefined | number, m08?: undefined | number): Mat3
  • Parameters

    Returns Mat3

  • Parameters

    • Optional m00: undefined | number
    • Optional m01: undefined | number
    • Optional m02: undefined | number
    • Optional m03: undefined | number
    • Optional m04: undefined | number
    • Optional m05: undefined | number
    • Optional m06: undefined | number
    • Optional m07: undefined | number
    • Optional m08: undefined | number

    Returns Mat3

Properties

m00

m00: number

Value at column 0 row 0 of the matrix.

m01

m01: number

Value at column 0 row 1 of the matrix.

m02

m02: number

Value at column 0 row 2 of the matrix.

m03

m03: number

Value at column 1 row 0 of the matrix.

m04

m04: number

Value at column 1 row 1 of the matrix.

m05

m05: number

Value at column 1 row 2 of the matrix.

m06

m06: number

Value at column 2 row 0 of the matrix.

m07

m07: number

Value at column 2 row 1 of the matrix.

m08

m08: number

Value at column 2 row 2 of the matrix.

Static IDENTITY

IDENTITY: {} = Object.freeze(new Mat3())

Type declaration

Methods

add

  • add(mat: Mat3): this
  • Adds the current matrix and another matrix to the current matrix.

    Parameters

    • mat: Mat3

      the second operand

    Returns this

clone

determinant

  • determinant(): number

equals

  • equals(other: Mat3, epsilon?: number): boolean
  • Returns whether the specified matrices are approximately equal.

    Parameters

    • other: Mat3

      Comparative matrix

    • Default value epsilon: number = EPSILON

      The error allowed. It`s should be a non-negative number.

    Returns boolean

    Returns true' when the elements of both matrices are equal; otherwise returnsfalse'.

fromQuat

  • fromQuat(q: Quat): this

identity

  • identity(): this

invert

  • invert(): this
  • Inverts the current matrix. When matrix is not invertible the matrix will be set to zeros.

    Returns this

multiply

  • multiply(mat: Mat3): this

multiplyScalar

  • multiplyScalar(scalar: number): this
  • Multiply each element of the current matrix by a scalar number.

    Parameters

    • scalar: number

      amount to scale the matrix's elements by

    Returns this

rotate

  • rotate(rad: number): this
  • Rotates the current matrix by the given angle.

    Parameters

    • rad: number

      radius of rotation

    Returns this

scale

  • scale(vec: Vec3): this
  • Multiply the current matrix with a scale matrix given by a scale vector.

    Parameters

    • vec: Vec3

      vector to scale by

    Returns this

set

  • set(other: Mat3): any
  • set(m00?: undefined | number, m01?: undefined | number, m02?: undefined | number, m03?: undefined | number, m04?: undefined | number, m05?: undefined | number, m06?: undefined | number, m07?: undefined | number, m08?: undefined | number): any
  • Sets the matrix with another one's value.

    Parameters

    • other: Mat3

      Specified matrix

    Returns any

    this

  • Set the matrix with values of all elements

    Parameters

    • Optional m00: undefined | number
    • Optional m01: undefined | number
    • Optional m02: undefined | number
    • Optional m03: undefined | number
    • Optional m04: undefined | number
    • Optional m05: undefined | number
    • Optional m06: undefined | number
    • Optional m07: undefined | number
    • Optional m08: undefined | number

    Returns any

    this

strictEquals

  • strictEquals(other: Mat3): boolean
  • Returns whether the specified matrices are equal.

    Parameters

    • other: Mat3

      Comparative matrix

    Returns boolean

    Returns true' when the elements of both matrices are equal; otherwise returnsfalse'.

subtract

  • subtract(mat: Mat3): this

toString

  • toString(): string

transpose

  • transpose(): this

Static add

  • add<Out>(out: Out, a: Out, b: Out): Out

Static clone

  • clone<Out>(a: Out): Mat3

Static copy

  • copy<Out>(out: Out, a: Out): Out
  • Copy content of a matrix into another and save the results to out matrix

    Type parameters

    Parameters

    • out: Out
    • a: Out

    Returns Out

Static determinant

  • determinant<Out>(a: Out): number

Static equals

  • equals<Out>(a: Out, b: Out, epsilon?: number): boolean
  • Returns whether the specified matrices are approximately equal.

    Type parameters

    Parameters

    • a: Out
    • b: Out
    • Default value epsilon: number = EPSILON

    Returns boolean

Static fromArray

  • fromArray<Out>(out: Out, arr: IWritableArrayLike<number>, ofs?: number): Out
  • Generates or sets a matrix with a flat array

    Type parameters

    Parameters

    • out: Out
    • arr: IWritableArrayLike<number>
    • Default value ofs: number = 0

      Array Start Offset

    Returns Out

Static fromMat4

Static fromQuat

Static fromRotation

  • fromRotation<Out>(out: Out, rad: number): Out
  • Sets the given matrix with a given angle and save the results to out matrix

    Type parameters

    Parameters

    • out: Out
    • rad: number

    Returns Out

Static fromScaling

  • fromScaling<Out, VecLike>(out: Out, v: VecLike): Out

Static fromTranslation

  • fromTranslation<Out, VecLike>(out: Out, v: VecLike): Out

Static fromViewUp

  • fromViewUp<Out, VecLike>(out: Out, view: VecLike, up?: Vec3): Out
  • Sets a third order matrix with view direction and up direction. Then save the results to out matrix

    Type parameters

    Parameters

    • out: Out
    • view: VecLike

      The view direction, it`s must be normalized.

    • Optional up: Vec3

      The view up direction, it`s must be normalized, default value is (0, 1, 0).

    Returns Out

Static identity

  • identity<Out>(out: Out): Out

Static inverseTransposeMat4

  • inverseTransposeMat4<Out>(out: Out, a: IMat4Like): null | Out

Static invert

  • invert<Out>(out: Out, a: Out): Out
  • Inverts a matrix. When matrix is not invertible the matrix will be set to zeros.

    Type parameters

    Parameters

    • out: Out
    • a: Out

    Returns Out

Static multiply

  • multiply<Out>(out: Out, a: Out, b: Out): Out
  • Multiply two matrices explicitly and save the results to out matrix

    Type parameters

    Parameters

    • out: Out
    • a: Out
    • b: Out

    Returns Out

Static multiplyMat4

  • multiplyMat4<Out>(out: Out, a: Out, b: IMat4Like): Out

Static multiplyScalar

  • multiplyScalar<Out>(out: Out, a: Out, b: number): Out
  • Multiply each element of a matrix by a scalar number and save the results to out matrix

    Type parameters

    Parameters

    • out: Out
    • a: Out
    • b: number

    Returns Out

Static multiplyScalarAndAdd

  • multiplyScalarAndAdd<Out>(out: Out, a: Out, b: Out, scale: number): Out
  • Adds two matrices after multiplying each element of the second operand by a scalar number. And save the results to out matrix.

    Type parameters

    Parameters

    • out: Out
    • a: Out
    • b: Out
    • scale: number

    Returns Out

Static rotate

  • rotate<Out>(out: Out, a: Out, rad: number): Out
  • Rotates the transform by the given angle and save the results into the out matrix

    Type parameters

    Parameters

    • out: Out
    • a: Out
    • rad: number

      radius of rotation

    Returns Out

Static scale

  • scale<Out, VecLike>(out: Out, a: Out, v: VecLike): Out
  • Multiply a matrix with a scale matrix given by a scale vector and save the results to out matrix

    Type parameters

    Parameters

    • out: Out
    • a: Out
    • v: VecLike

    Returns Out

Static set

  • set<Out>(out: Out, m00: number, m01: number, m02: number, m10: number, m11: number, m12: number, m20: number, m21: number, m22: number): Out
  • Sets the elements of a matrix with the given values and save the results to out matrix

    Type parameters

    Parameters

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

    Returns Out

Static strictEquals

  • strictEquals<Out>(a: Out, b: Out): boolean

Static subtract

  • subtract<Out>(out: Out, a: Out, b: Out): Out
  • Subtracts matrix b from matrix a and save the results to out matrix

    Type parameters

    Parameters

    • out: Out
    • a: Out
    • b: Out

    Returns Out

Static toArray

  • toArray<Out>(out: Out, m: IMat3Like, ofs?: number): Out
  • Transform a matrix object to a flat array

    Type parameters

    • Out: IWritableArrayLike<number>

    Parameters

    • out: Out
    • m: IMat3Like
    • Default value ofs: number = 0

      Array Start Offset

    Returns Out

Static transform

  • transform<Out, VecLike>(out: Out, a: Out, v: VecLike): Out

Static transpose

  • transpose<Out>(out: Out, a: Out): Out

Generated using TypeDoc