Options
All
  • Public
  • Public/Protected
  • All
Menu

A 4x4 (square) matrix of numbers.

An adapter for a Float32Array.

Hierarchy

Implements

Index

Constructors

constructor

  • new Matrix4(elements: Float32Array): Matrix4

Properties

modified

modified: boolean

Static Readonly one

one: Matrix4 = lock(new Matrix4(new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])))

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

Static Readonly zero

zero: Matrix4 = lock(new Matrix4(new Float32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])))

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

Accessors

dimensions

  • get dimensions(): number
  • set dimensions(unused: number): void

elements

  • get elements(): Float32Array
  • set elements(elements: Float32Array): void

Methods

__mul__

__rmul__

add

add2

clone

compose

  • compose(S: VectorE3, R: SpinorE3, T: VectorE3): this
  • Sets this matrix to perform the specified scaling, rotation, and translation.

    Parameters

    • S: VectorE3
    • R: SpinorE3
    • T: VectorE3

    Returns this

copy

det

  • det(): number

frustum

  • frustum(left: number, right: number, bottom: number, top: number, near: number, far: number): this
  • Parameters

    • left: number
    • right: number
    • bottom: number
    • top: number
    • near: number
    • far: number

    Returns this

getElement

  • getElement(row: number, column: number): number

inv

  • inv(): this

isLocked

  • isLocked(): boolean

isOne

  • isOne(): boolean

lock

  • lock(): number

mul

mul2

one

  • one(): this

perspective

  • perspective(fov: number, aspect: number, near: number, far: number): this
  • Sets this matrix to the viewing transformation. This is the matrix that may be applied to points in the truncated viewing pyramid. The resulting points then lie in the image space (cube).

    Parameters

    • fov: number
    • aspect: number
    • near: number
    • far: number

    Returns this

reflection

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

    this ⟼ reflection(n)

    Parameters

    • n: VectorE3

    Returns this

rmul

rotate

  • rotate(spinor: SpinorE3): this

rotation

  • rotation(spinor: SpinorE3): this
  • Sets this matrix to be equivalent to the spinor.

    this ⟼ rotation(spinor)

    Parameters

    • spinor: SpinorE3

    Returns this

rotationAxis

  • rotationAxis(axis: VectorE3, angle: number): this

row

  • row(i: number): Array<number>

scale

  • scale(s: number): this
  • Multiplies all elements of this matrix by the specified value.

    Parameters

    • s: number

    Returns this

scaleXYZ

  • scaleXYZ(scale: VectorE3): this

scaling

  • scaling(scale: VectorE3): this

set

  • set(n11: number, n12: number, n13: number, n14: number, n21: number, n22: number, n23: number, n24: number, n31: number, n32: number, n33: number, n34: number, n41: number, n42: number, n43: number, n44: number): this
  • Parameters

    • n11: number
    • n12: number
    • n13: number
    • n14: number
    • n21: number
    • n22: number
    • n23: number
    • n24: number
    • n31: number
    • n32: number
    • n33: number
    • n34: number
    • n41: number
    • n42: number
    • n43: number
    • n44: number

    Returns this

setElement

  • setElement(row: number, column: number, value: number): void

toExponential

  • toExponential(fractionDigits?: number): string

toFixed

  • toFixed(fractionDigits?: number): string

toPrecision

  • toPrecision(fractionDigits?: number): string

toString

  • toString(radix?: number): string

translate

  • translate(d: VectorE3): this

translation

  • translation(displacement: VectorE3): this
  • Sets this matrix to be equivalent to the displacement vector argument.

    Parameters

    • displacement: VectorE3

    Returns this

transpose

  • transpose(): this

unlock

  • unlock(token: number): void

zero

  • zero(): this

Static rotation

  • rotation(spinor: SpinorE3): Matrix4

Static scaling

  • scaling(scale: VectorE3): Matrix4

Static translation

  • translation(vector: VectorE3): Matrix4

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Property
  • Method
  • Protected property
  • Protected method
  • Static property
  • Static method

Generated using TypeDoc