Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Mat3

表示三维(3x3)矩阵。

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

矩阵第 0 列第 0 行的元素。

m01

m01: number

矩阵第 0 列第 1 行的元素。

m02

m02: number

矩阵第 0 列第 2 行的元素。

m03

m03: number

矩阵第 1 列第 0 行的元素。

m04

m04: number

矩阵第 1 列第 1 行的元素。

m05

m05: number

矩阵第 1 列第 2 行的元素。

m06

m06: number

矩阵第 2 列第 0 行的元素。

m07

m07: number

矩阵第 2 列第 1 行的元素。

m08

m08: number

矩阵第 2 列第 2 行的元素。

Static IDENTITY

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

Type declaration

Methods

add

  • add(mat: Mat3): this
  • 矩阵加法。将当前矩阵与指定矩阵的相加,结果返回给当前矩阵。

    Parameters

    • mat: Mat3

      the second operand

    Returns this

clone

determinant

  • determinant(): number

equals

  • equals(other: Mat3, epsilon?: number): boolean
  • 判断当前矩阵是否在误差范围内与指定矩阵相等。

    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
  • 重置当前矩阵的值,使其表示指定四元数表示的旋转变换。

    Parameters

    • q: Quat

      The quaternion.

    Returns this

    this

identity

  • identity(): this

invert

  • invert(): this
  • 计算当前矩阵的逆矩阵。注意,在矩阵不可逆时,会返回一个全为 0 的矩阵。

    Returns this

multiply

  • multiply(mat: Mat3): this
  • 矩阵乘法。将当前矩阵左乘指定矩阵的结果赋值给当前矩阵。

    Parameters

    • mat: Mat3

      the second operand

    Returns this

multiplyScalar

  • multiplyScalar(scalar: number): this
  • 矩阵数乘。将当前矩阵与指定标量的数乘结果赋值给当前矩阵。

    Parameters

    • scalar: number

      amount to scale the matrix's elements by

    Returns this

rotate

  • rotate(rad: number): this
  • 将当前矩阵左乘旋转矩阵的结果赋值给当前矩阵,旋转矩阵由旋转轴和旋转角度给出。

    Parameters

    • rad: number

      radius of rotation

    Returns this

scale

  • scale(vec: Vec3): this
  • 将当前矩阵左乘缩放矩阵的结果赋值给当前矩阵,缩放矩阵由各个轴的缩放给出。

    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
  • 设置当前矩阵使其与指定矩阵相等。

    Parameters

    • other: Mat3

      Specified matrix

    Returns any

    this

  • 设置当前矩阵指定元素值。

    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
  • 判断当前矩阵是否与指定矩阵相等。

    Parameters

    • other: Mat3

      Comparative matrix

    Returns boolean

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

subtract

  • subtract(mat: Mat3): this
  • 计算矩阵减法。将当前矩阵减去指定矩阵的结果赋值给当前矩阵。

    Parameters

    • mat: Mat3

      the second operand

    Returns 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

Static determinant

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

Static equals

  • equals<Out>(a: Out, b: Out, epsilon?: number): boolean
  • 排除浮点数误差的矩阵近似等价判断

    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
  • 数组转矩阵

    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

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
  • 根据视口前方向和上方向计算矩阵

    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
  • 矩阵求逆,注意,在矩阵不可逆时,会返回一个全为 0 的矩阵。

    Type parameters

    Parameters

    • out: Out
    • a: Out

    Returns Out

Static multiply

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

Static multiplyMat4

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

Static multiplyScalar

  • multiplyScalar<Out>(out: Out, a: Out, b: number): Out

Static multiplyScalarAndAdd

  • multiplyScalarAndAdd<Out>(out: Out, a: Out, b: Out, scale: number): Out

Static rotate

  • rotate<Out>(out: Out, a: Out, rad: number): Out
  • 在给定矩阵变换基础上加入新旋转变换

    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

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
  • 设置矩阵值

    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

Static toArray

  • toArray<Out>(out: Out, m: IMat3Like, ofs?: number): Out
  • 矩阵转数组

    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