Class: Mat4

Mat4

Class represents a 4x4 matrix.

new Mat4()

Classes

Mat4

Members

_mArray.<number>

A 4x4 matrix, indexable as a column-major order array.

Methods

Duplicates a Matrix3 instance.
Returns:
Type Description
Mat4 -
Copy matrix.
Name Type Description
a Mat3 Matrix to copy.

eulerToMatrix(ax, ay, az){Mat4}

Sets current rotation matrix by euler's angles.
Name Type Description
ax number Rotation angle in radians arond X axis.
ay number Rotation angle in radians arond Y axis.
az number Rotation angle in radians arond Z axis.
Returns:
Type Description
Mat4 -

inverseTo(){Mat4}

Creates an inversed matrix of the current.
Returns:
Type Description
Mat4 -
Computes the product of two matrices.
Name Type Description
mx Mat4 Matrix to multiply.
Returns:
Type Description
Mat4 -

mulVec3(p){Vec3}

Multiply to 3d vector.
Name Type Description
p Vec3 3d vector.
Returns:
Type Description
Vec3 -

mulVec4(p){Vec4}

Multiply to 4d vector.
Name Type Description
p Vec4 4d vector.
Returns:
Type Description
Vec4 -

rotate(u, angle){Mat4}

Rotate currrent matrix around the aligned axis and angle.
Name Type Description
u Vec3 Aligned axis.
angle number Aligned axis angle in radians.
Returns:
Type Description
Mat4 -

rotateBetweenVectors(a, b){Mat4}

Gets the rotation matrix from one vector to another.
Name Type Description
a Vec3 Firtst vector.
b Vec3 Second vector.
Returns:
Type Description
Mat4 -
Scale current matrix to the vector values.
Name Type Description
v Vec3 Scale vector.
Returns:
Type Description
Mat4 -
Sets column-major order array matrix.
Name Type Description
m Array.<number> Matrix array.
Returns:
Type Description
Mat4 -

setIdentity(){Mat4}

Sets matrix to identity.
Returns:
Type Description
Mat4 -

setOrtho(left, right, bottom, top, near, far){Mat4}

Creates current orthographic projection matrix.
Name Type Description
left number -
right number -
bottom number -
top number -
near number -
far number -
Returns:
Type Description
Mat4 -

setPerspective(left, right, bottom, top, near, far){Mat4}

Sets perspective projection matrix frustum values.
Name Type Description
left number -
right number -
bottom number -
top number -
near number -
far number -
Returns:
Type Description
Mat4 -

setRotation(u, angle){Mat4}

Sets current rotation matrix around the aligned axis and angle.
Name Type Description
u Vec3 Aligned axis.
angle number Aligned axis angle in radians.
Returns:
Type Description
Mat4 -

toInverseMatrix3(){Mat3}

Creates an inversed 3x3 matrix of the current.
Returns:
Type Description
Mat3 -

toMatrix3(){Mat3}

Converts to 3x3 matrix.
Returns:
Type Description
Mat3 -

translate(v){Mat4}

Add translation vector to the current matrix.
Name Type Description
v Vec3 Translate vector.
Returns:
Type Description
Mat4 -

translateToPosition(v){Mat4}

Sets translation matrix to the position.
Name Type Description
v Vec3 Translate to position.
Returns:
Type Description
Mat4 -

transposeTo(){Mat4}

Creates a trasposed matrix of the current.
Returns:
Type Description
Mat4 -

staticMat4.identity(){Mat4}

Returns identity matrix instance.
Returns:
Type Description
Mat4 -