Mat44

Mat44

A 4x4 column-major matrix.

Constructor

new Mat44()

Instantiates a Mat44 object.
Source:

Methods

addMat33(that) → {Mat44}

Adds the matrix with the provided matrix argument, returning a new Ma33 object.
Parameters:
Name Type Description
that Mat33 | Array The matrix to add.
Source:
Returns:
The sum of the two matrices.
Type
Mat44

addMat44(that) → {Mat44}

Adds the matrix with the provided matrix argument, returning a new Ma33 object.
Parameters:
Name Type Description
that Mat44 | Array The matrix to add.
Source:
Returns:
The sum of the two matrices.
Type
Mat44

col(index, vec) → {Vec4}

Returns a column of the matrix as a Vec4 object.
Parameters:
Name Type Description
index number The 0-based col index.
vec Vec3 | Array The vector to replace the col. Optional.
Source:
Returns:
The column vector.
Type
Vec4

decompose() → {Object}

Decomposes the matrix into the corresponding rotation, translation, and scale components.
Source:
Returns:
The decomposed components of the matrix.
Type
Object

divScalar(that) → {Mat44}

Divides all components of the matrix by the provded scalar argument, returning a new Mat44 object.
Parameters:
Name Type Description
that number The scalar to divide the matrix by.
Source:
Returns:
The resulting matrix.
Type
Mat44

equals(that, epsilon) → {boolean}

Returns true if the all components match those of a provided matrix. An optional epsilon value may be provided.
Parameters:
Name Type Description
that Mat44 | Array The matrix to test equality with.
epsilon number The epsilon value. Optional.
Source:
Returns:
Whether or not the matrix components match.
Type
boolean

inverse() → {Mat44}

Returns the inverse of the matrix.
Source:
Returns:
The inverted matrix.
Type
Mat44

inverseRotation() → {Mat44}

Returns the inverse of the transform's rotation matrix.
Source:
Returns:
The inverse rotation matrix.
Type
Mat44

inverseScale() → {Mat44}

Returns the inverse of the transform's scale matrix.
Source:
Returns:
The inverse scale matrix.
Type
Mat44

inverseTranslation() → {Mat44}

Returns the inverse of the transform's translation matrix.
Source:
Returns:
The inverse translation matrix.
Type
Mat44

multMat33(that) → {Mat44}

Multiplies the provded matrix argument by the matrix, returning a new Mat44 object.
Parameters:
Name Type Description
that Mat33 | Array The matrix to be multiplied by the matrix.
Source:
Returns:
The resulting matrix.
Type
Mat44

multMat44(that) → {Mat44}

Multiplies the provded matrix argument by the matrix, returning a new Mat44 object.
Parameters:
Name Type Description
that Mat44 | Array The matrix to be multiplied by the matrix.
Source:
Returns:
The resulting matrix.
Type
Mat44

multScalar(that) → {Mat44}

Multiplies all components of the matrix by the provded scalar argument, returning a new Mat44 object.
Parameters:
Name Type Description
that number The scalar to multiply the matrix by.
Source:
Returns:
The resulting matrix.
Type
Mat44

multVec3(that) → {Vec3}

Multiplies the provded vector argument by the matrix, returning a new Vec3 object.
Parameters:
Name Type Description
that Vec3 | Vec4 | Array The vector to be multiplied by the matrix.
Source:
Returns:
The resulting vector.
Type
Vec3

multVec4(that) → {Vec4}

Multiplies the provded vector argument by the matrix, returning a new Vec3 object.
Parameters:
Name Type Description
that Vec3 | Vec4 | Array The vector to be multiplied by the matrix.
Source:
Returns:
The resulting vector.
Type
Vec4

rotation() → {Mat44}

Returns the rotation matrix from the affine-transformation.
Source:
Returns:
The rotation matrix.
Type
Mat44

row(index, vec) → {Vec4}

Returns a row of the matrix as a Vec4 object.
Parameters:
Name Type Description
index number The 0-based row index.
vec Vec3 | Array The vector to replace the row. Optional.
Source:
Returns:
The row vector.
Type
Vec4

scale() → {Mat44}

Returns the scale matrix from the affine-transformation.
Source:
Returns:
The scale matrix.
Type
Mat44

subMat33(that) → {Mat44}

Subtracts the provided matrix argument from the matrix, returning a new Mat44 object.
Parameters:
Name Type Description
that Mat33 | Array The matrix to add.
Source:
Returns:
The difference of the two matrices.
Type
Mat44

subMat44(that) → {Mat44}

Subtracts the provided matrix argument from the matrix, returning a new Mat44 object.
Parameters:
Name Type Description
that Mat44 | Array The matrix to add.
Source:
Returns:
The difference of the two matrices.
Type
Mat44

toArray() → {Array}

Returns an array representation of the matrix.
Source:
Returns:
The matrix as an array.
Type
Array

toMat33() → {Mat33}

Returns an the matrix representation as a 3x3 Mat33 object.
Source:
Returns:
The matrix as an array.
Type
Mat33

toString() → {String}

Returns a string representation of the matrix.
Source:
Returns:
The string representation of the matrix.
Type
String

translation() → {Mat44}

Returns the translation matrix from the affine-transformation.
Source:
Returns:
The translation matrix.
Type
Mat44

transpose() → {Mat44}

Returns the transpose of the matrix.
Source:
Returns:
The transposed matrix.
Type
Mat44

(static) identity() → {Mat44}

Returns the identity matrix.
Source:
Returns:
The identiy matrix.
Type
Mat44

(static) random() → {Mat44}

Returns a random transform matrix composed of a rotation and scale.
Source:
Returns:
A random transform matrix.
Type
Mat44

(static) rotation(angle, axis) → {Mat44}

Returns a rotation matrix defined by an axis and an angle.
Parameters:
Name Type Description
angle number The angle of the rotation, in radians.
axis Vec3 The axis of the rotation.
Source:
Returns:
The rotation matrix.
Type
Mat44

(static) rotationFromTo(from, to) → {Mat44}

Returns a rotation matrix to rotate a vector from one direction to another.
Parameters:
Name Type Description
from Vec3 The starting direction.
to Vec3 The ending direction.
Source:
Returns:
The matrix representing the rotation.
Type
Mat44

(static) scale(scale) → {Mat44}

Returns a scale matrix.
Parameters:
Name Type Description
scale Vec3 | Array | number The scalar or vector scaling factor.
Source:
Returns:
The scale matrix.
Type
Mat44

(static) translation(translation) → {Mat44}

Returns a translation matrix.
Parameters:
Name Type Description
translation Vec3 | Array The translation vector.
Source:
Returns:
The translation matrix.
Type
Mat44