Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Mat4

Hierarchy

  • Mat4

Index

Constructors

constructor

  • new Mat4(...args: number[]): Mat4
  • Parameters

    • Rest ...args: number[]

    Returns Mat4

Properties

Private #a11

#a11: number = 0

(getter/setter) The a11 value of the matrix.

default

0

Private #a12

#a12: number = 0

(getter/setter) The a12 value of the matrix.

default

0

Private #a13

#a13: number = 0

(getter/setter) The a13 value of the matrix.

default

0

Private #a14

#a14: number = 0

(getter/setter) The a14 value of the matrix.

default

0

Private #a21

#a21: number = 0

(getter/setter) The a21 value of the matrix.

default

0

Private #a22

#a22: number = 0

(getter/setter) The a22 value of the matrix.

default

0

Private #a23

#a23: number = 0

(getter/setter) The a23 value of the matrix.

default

0

Private #a24

#a24: number = 0

(getter/setter) The a24 value of the matrix.

default

0

Private #a31

#a31: number = 0

(getter/setter) The a31 value of the matrix.

default

0

Private #a32

#a32: number = 0

(getter/setter) The a32 value of the matrix.

default

0

Private #a33

#a33: number = 0

(getter/setter) The a33 value of the matrix.

default

0

Private #a34

#a34: number = 0

(getter/setter) The a34 value of the matrix.

default

0

Private #a41

#a41: number = 0

(getter/setter) The a41 value of the matrix.

default

0

Private #a42

#a42: number = 0

(getter/setter) The a42 value of the matrix.

default

0

Private #a43

#a43: number = 0

(getter/setter) The a43 value of the matrix.

default

0

Private #a44

#a44: number = 0

(getter/setter) The a44 value of the matrix.

default

0

Accessors

a11

  • get a11(): number
  • set a11(v: number): void

a12

  • get a12(): number
  • set a12(v: number): void

a13

  • get a13(): number
  • set a13(v: number): void

a14

  • get a14(): number
  • set a14(v: number): void

a21

  • get a21(): number
  • set a21(v: number): void

a22

  • get a22(): number
  • set a22(v: number): void

a23

  • get a23(): number
  • set a23(v: number): void

a24

  • get a24(): number
  • set a24(v: number): void

a31

  • get a31(): number
  • set a31(v: number): void

a32

  • get a32(): number
  • set a32(v: number): void

a33

  • get a33(): number
  • set a33(v: number): void

a34

  • get a34(): number
  • set a34(v: number): void

a41

  • get a41(): number
  • set a41(v: number): void

a42

  • get a42(): number
  • set a42(v: number): void

a43

  • get a43(): number
  • set a43(v: number): void

a44

  • get a44(): number
  • set a44(v: number): void

array

  • get array(): number[]
  • (getter) Returns the basic array representation of this matrix.

    readonly

    Returns number[]

determinant

  • get determinant(): number
  • Calculates the determinant of the mat4

    Returns number

    determinant of a

determinantFunction

  • get determinantFunction(): Mat4DeterminantFunction
  • Calculates the determinant function the mat4

    Returns Mat4DeterminantFunction

    determinant of a

frobeniusnorm

  • get frobeniusnorm(): number

rotation

  • get rotation(): Quat

scaling

  • get scaling(): Vec3

translation

  • get translation(): Vec3

Methods

[iterator]

  • [iterator](): { next: any }
  • Adds iteration to the object, allowing it to be destructured and iterated upon in various useful ways.

    Returns { next: any }

    • next: function
      • next(): { done: boolean; value: number } | { done: boolean; value: undefined }
      • Returns { done: boolean; value: number } | { done: boolean; value: undefined }

add

addNew

clone

invert

invertNew

multiply

multiplyNew

multiplyScalar

  • multiplyScalar(s: number): Mat4

multiplyScalarNew

  • multiplyScalarNew(s: number): Mat4

reset

  • reset(...args: number[]): Mat4
  • Parameters

    • Rest ...args: number[]

    Returns Mat4

resetToMat4

rotate

  • rotate(r: number, axis: any): Mat4
  • Rotates a mat4 by the given angle around the given axis

    Parameters

    • r: number

      the angle to rotate the matrix by

    • axis: any

      the axis to rotate around

    Returns Mat4

    output

rotateNew

  • rotateNew(r: number, axis: any): Mat4

scale

  • scale(s: number): Mat4

scaleByVec3

  • scaleByVec3(v: any): Mat4

scaleByVec3New

  • scaleByVec3New(v: any): Mat4

scaleNew

  • scaleNew(s: number): Mat4

subtract

subtractNew

toString

  • toString(): string

transform

  • transform(v: any): Mat4
  • Transforms the mat4 by a given amount

    Parameters

    • v: any

      The amount to add to the matrixes transformation properties

    Returns Mat4

    output

transformNew

  • transformNew(v: any): Mat4

transformTo

  • transformTo(v: any): Mat4
  • Transforms the mat4 to a given position

    Parameters

    • v: any

      The amount to add to the matrixes transformation properties

    Returns Mat4

    output

transformToNew

  • transformToNew(v: any): Mat4

translate

  • translate(v: any): Mat4
  • Translates the mat4 to a given position

    Parameters

    • v: any

      The amount to add to the matrixes translation properties

    Returns Mat4

    output

translateNew

  • translateNew(v: any): Mat4

transpose

transposeNew

  • transposeNew(): Mat4

Static fromQuat

  • fromQuat(q: any): Mat4
  • Calculates a 4x4 matrix from the given quaternion

    Parameters

    • q: any

      Quaternion to create matrix from

    Returns Mat4

    out

Static fromRotation

  • fromRotation(r: any, axis: any): Mat4

Static fromRotationTranslationScale

  • fromRotationTranslationScale(q: any, v: any, s: any): Mat4
  • Creates a matrix from a quaternion rotation, vector translation and vector scale This is equivalent to (but much faster than):

    mat4.identity(dest);
    mat4.translate(dest, vec);
    let quatMat = mat4.create();
    quat4.toMat4(quat, quatMat);
    mat4.multiply(dest, quatMat);
    mat4.scale(dest, scale)
    

    Parameters

    • q: any

      Rotation quaternion

    • v: any

      Translation vector

    • s: any

      Scaling vector

    Returns Mat4

    out

Static fromRotationTranslationScaleOrigin

  • fromRotationTranslationScaleOrigin(q: any, v: any, s: any, o: any): Mat4
  • Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin This is equivalent to (but much faster than):

    mat4.identity(dest);
    mat4.translate(dest, vec);
    mat4.translate(dest, origin);
    let quatMat = mat4.create();
    quat4.toMat4(quat, quatMat);
    mat4.multiply(dest, quatMat);
    mat4.scale(dest, scale)
    mat4.translate(dest, negativeOrigin);
    

    Parameters

    • q: any

      Rotation quaternion

    • v: any

      Translation vector

    • s: any

      Scaling vector

    • o: any

      The origin vector around which to scale and rotate

    Returns Mat4

    out

Static fromScalingVec3

  • fromScalingVec3(v: any): Mat4

Static fromTranslatingVec3

  • fromTranslatingVec3(v: any): Mat4

Static fromXRotation

  • fromXRotation(r: any): Mat4

Static fromYRotation

  • fromYRotation(r: any): Mat4

Static fromZRotation

  • fromZRotation(r: any): Mat4

Static frustum

  • frustum(left: any, right: any, bottom: any, top: any, near: any, far: any): Mat4
  • Generates a frustum matrix with the given bounds

    Parameters

    • left: any

      Left bound of the frustum

    • right: any

      Right bound of the frustum

    • bottom: any

      Bottom bound of the frustum

    • top: any

      Top bound of the frustum

    • near: any

      Near bound of the frustum

    • far: any

      Far bound of the frustum

    Returns Mat4

    out

Static lookAt

  • lookAt(eye: any, center: any, up: any): Mat4
  • Generates a look-at matrix with the given eye position, focal point, and up axis. If you want a matrix that actually makes an object look at another object, you should use targetTo instead.

    Parameters

    • eye: any

      Position of the viewer

    • center: any

      Point the viewer is looking at

    • up: any

      vec3 pointing up

    Returns Mat4

    out

Static ortho

  • ortho(left: any, right: any, bottom: any, top: any, near: any, far: any): Mat4
  • Generates a orthogonal projection matrix with the given bounds

    Parameters

    • left: any

      Left bound of the frustum

    • right: any

      Right bound of the frustum

    • bottom: any

      Bottom bound of the frustum

    • top: any

      Top bound of the frustum

    • near: any

      Near bound of the frustum

    • far: any

      Far bound of the frustum

    Returns Mat4

    out

Static perspective

  • perspective(fovy: any, aspect: any, near: any, far: any): Mat4
  • Generates a perspective projection matrix with the given bounds. Passing null/undefined/no value for far will generate infinite projection matrix.

    Parameters

    • fovy: any

      Vertical field of view in radians

    • aspect: any

      Aspect ratio. typically viewport width/height

    • near: any

      Near bound of the frustum

    • far: any

      Far bound of the frustum, can be null or Infinity

    Returns Mat4

    out

Static targetTo

  • targetTo(eye: any, target: any, up: any): Mat4
  • Generates a matrix that makes something look at something else.

    Parameters

    • eye: any

      Position of the viewer

    • target: any
    • up: any

      vec3 pointing up

    Returns Mat4

    out

Generated using TypeDoc