Options
All
  • Public
  • Public/Protected
  • All
Menu

This Class represents a 4x4 Matrix

export

Hierarchy

  • Matrix4

Index

Constructors

constructor

  • new Matrix4(data: number[][]): Matrix4
  • Creates an instance of Matrix3.

    memberof

    Matrix4

    Parameters

    • data: number[][]

      The initial values for the matrx needs to be 3x3.

    Returns Matrix4

Properties

data

data: number[][]

The data of the Matrix in a twodimensinal array.

memberof

Matrix4

Methods

To1D

  • To1D(): Float32Array
  • Returns a onedimensional representation for use in Shaders. Concatenates the rows.

    Returns Float32Array

invert

  • Copied from the excercise and modified to suite my implementation!!!

    Returns Matrix4

multiply

  • Multiplies with another matrix to create a new instance.

    If the current matrix is A and the one provided by mat is B then it's AB. Mind the order!

    memberof

    Matrix4

    Parameters

    Returns Matrix4

Static Frustum

  • Frustum(left: number, right: number, bottom: number, top: number, near: number, far: number): Matrix4
  • Constructs a new matrix that represents a projection normalisation transformation

    Parameters

    • left: number

      Camera-space left value of lower near point

    • right: number

      Camera-space right value of upper right far point

    • bottom: number

      Camera-space bottom value of lower lower near point

    • top: number

      Camera-space top value of upper right far point

    • near: number

      Camera-space near value of lower lower near point

    • far: number

      Camera-space far value of upper right far point

    Returns Matrix4

    The resulting frustum matrix

Static Identity

  • Returns the fourdim identity matrix. If row == col => 1 else => 0

    static
    memberof

    Matrix4

    Returns Matrix4

Static LookAt

  • Creates a LookAtMatrix.

    Parameters

    Returns Matrix4

Static Perspective

  • Perspective(fovy: number, aspect: number, near: number, far: number): Matrix4
  • Constructs a new matrix that represents a projection normalisation transformation.

    Parameters

    • fovy: number

      Field of view in y-direction in radians!!!

    • aspect: number

      Aspect ratio between width and height

    • near: number

      Camera-space distance to near plane

    • far: number

      Camera-space distance to far plane

    Returns Matrix4

    The resulting matrix

Static Rotation

  • Returns a Rotationmatrix for the specified axis and angle.

    Parameters

    • axis: Vector3 | Vector4

      The base axis for the rotation. One-hot encoded dimension => only one dimension is 1 the oners are 0.

    • angle: number

      The angle to rotate in radians.

    Returns Matrix4

Static Scale

  • Returns a scaling matrix. Only scaling of all dimesions allowed to preserve normals.

    Parameters

    • v: number

      Factor used for scaling.

    Returns Matrix4

Static Translation

  • Returns a Translationmatrix with the spezified parameters.

    Parameters

    • v: Vector3 | Vector4

      A 3 or 4 dimensional Vector that holds the desired translation parameters.

    Returns Matrix4

Static Zero

  • Returns an instance filled with zeros.

    static
    memberof

    Matrix4

    Returns Matrix4

Generated using TypeDoc