Class Matrix3

Hierarchy

  • Matrix3

Constructors

Properties

mat: number[]

An array of 9 numbers representing a 3x3 matrix

IDENTITY: Matrix3 = ...

A static Matrix3 object representing the identity matrix

Methods

  • Creates a new Matrix3 object with the same values as this Matrix3.

    Returns

    A new Matrix3 object with the same values as this Matrix3.

    Returns Matrix3

  • Compose the current Matrix3 object from position, rotation, and scale

    Parameters

    • position: Vector2

      The Vector2 representing the position

    • rotation: number

      The angle to rotate by, in radians

    • scale: Vector2

      The Vector2 representing the scale to apply

    • shear: null | Vector2

    Returns void

  • Copies the values of the specified Matrix3 into this Matrix3.

    Parameters

    • m: Matrix3

      The Matrix3 to copy the values from

    Returns void

  • Returns the element at the specified row and column of the Matrix3.

    Returns

    The element at the specified row and column of the Matrix3

    Parameters

    • row: number

      The row of the element to return

    • col: number

      The column of the element to return

    Returns number

  • Gets the rotation quaternion of this Matrix4 object

    Returns

    The rotation angle in radians

    Returns number

  • Multiplies this Matrix4 with another Matrix3 on the right hand side, and sets this Matrix3 to the result.

    Parameters

    • rhs: Matrix3

      The Matrix3 to multiply with.

    Returns void

  • Multiplies this Matrix4 with another Matrix3 on the left hand side, and sets this Matrix3 to the result.

    Parameters

    Returns void

  • Sets the value of the specified element in the Matrix3.

    Parameters

    • value: number

      The value to set

    • row: number

      The row of the element to set

    • col: number

      The column of the element to set

    Returns void

  • Sets the elements of the Matrix3 in column major order.

    Parameters

    • n1: number

      The first element in the first column

    • n2: number

      The second element in the first column

    • n3: number

      The third element in the first column

    • n4: number

      The first element in the second column

    • n5: number

      The second element in the second column

    • n6: number

      The third element in the second column

    • n7: number

      The first element in the third column

    • n8: number

      The second element in the third column

    • n9: number

      The third element in the third column

    Returns void

  • Sets the rotation of this matrix from a given angle.

    Parameters

    • angle: number

      The angle in radians to set the rotation from.

    Returns void

  • Sets the elements of the Matrix3 in row major order.

    Parameters

    • n1: number

      The first element in the first row

    • n2: number

      The second element in the first row

    • n3: number

      The third element in the first row

    • n4: number

      The first element in the second row

    • n5: number

      The second element in the second row

    • n6: number

      The third element in the second row

    • n7: number

      The first element in the third row

    • n8: number

      The second element in the third row

    • n9: number

      The third element in the third row

    Returns void

  • Sets the scale of this matrix from a Vector2.

    Parameters

    • scale: Vector2

      The Vector2 to set the scale from.

    Returns void

  • Sets the translation of this matrix from a Vector2.

    Parameters

    • v: Vector2

      The Vector2 to set the translation from.

    Returns void

  • Creates a Matrix3 object from position, rotation, and scale

    Returns

    The resulting Matrix3 object

    Parameters

    • position: Vector2 = Vector2.ZERO

      The Vector2 representing the position

    • rotation: number = 0

      The angle to rotate by, in radians

    • scale: Vector2 = Vector2.ONE

      The Vector2 representing the scale to apply

    Returns Matrix3

  • Creates a new Matrix3 object from 9 numbers representing a column-major matrix

    Returns

    A new Matrix3 object created from the given numbers

    Parameters

    • n1: number

      Number in column 1, row 1

    • n2: number

      Number in column 2, row 1

    • n3: number

      Number in column 3, row 1

    • n4: number

      Number in column 1, row 2

    • n5: number

      Number in column 2, row 2

    • n6: number

      Number in column 3, row 2

    • n7: number

      Number in column 1, row 3

    • n8: number

      Number in column 2, row 3

    • n9: number

      Number in column 3, row 3

    Returns Matrix3

  • Creates a new Matrix3 object from 9 numbers representing a row-major matrix

    Returns

    A new Matrix3 object created from the given numbers

    Parameters

    • n1: number

      Number in row 1, column 1

    • n2: number

      Number in row 1, column 2

    • n3: number

      Number in row 1, column 3

    • n4: number

      Number in row 2, column 1

    • n5: number

      Number in row 2, column 2

    • n6: number

      Number in row 2, column 3

    • n7: number

      Number in row 3, column 1

    • n8: number

      Number in row 3, column 2

    • n9: number

      Number in row 3, column 3

    Returns Matrix3

  • Creates a new Matrix3 object representing a rotation matrix

    Returns

    A new Matrix3 object representing a rotation matrix

    Parameters

    • angle: number

      The angle of rotation, in radians

    Returns Matrix3

  • Creates a new Matrix3 object representing a scaling matrix

    Returns

    A new Matrix3 object representing a scaling matrix

    Parameters

    • scale: Vector2

      The Vector2 object representing the x and y scaling factors

    Returns Matrix3

  • Creates a new Matrix3 object representing a translation matrix

    Returns

    A new Matrix3 object representing a translation matrix

    Parameters

    • v: Vector2

      The Vector2 object representing the translation vector

    Returns Matrix3

Generated using TypeDoc