Class: Matrix4

og.math.Matrix4

new og.math.Matrix4()

Class represents a 4x4 matrix.

Members

_mArray.<number>

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

bottom

Projection frustum bottom value.

far

Projection frustum far value.

left

Projection frustum left value.

near

Projection frustum near value.
Projection frustum right value.

top

Projection frustum top value.

Methods

Duplicates a Matrix3 instance.
Returns:
Type Description
og.math.Matrix4
Copy matrix.
Name Type Description
a og.math.Matrix3 Matrix to copy.
Returns:
Type Description
og.math.Matrix4

eulerToMatrix(ax, ay, az){og.math.Matrix4}

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
og.math.Matrix4
Creates an inversed matrix of the current.
Returns:
Type Description
og.math.Matrix4
Computes the product of two matrices.
Name Type Description
mx og.math.Matrix4 Matrix to multiply.
Returns:
Type Description
og.math.Matrix4
Multiply to 3d vector.
Name Type Description
p og.math.Vector3 3d vector.
Returns:
Type Description
og.math.Vector3
Multiply to 4d vector.
Name Type Description
p og.math.Vector4 4d vector.
Returns:
Type Description
og.math.Vector4
Rotate currrent matrix around the aligned axis and angle.
Name Type Description
u og.math.Vector3 Aligned axis.
angle number Aligned axis angle in radians.
Returns:
Type Description
og.math.Matrix4

rotateBetweenVectors(a, b){og.math.Matrix4}

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

setFrustum(left, right, bottom, top, near, far){og.math.Matrix4}

Sets perspective projection matrix frustum values.
Name Type Description
left number
right number
bottom number
top number
near number
far number
Returns:
Type Description
og.math.Matrix4
Sets matrix to identity.
Returns:
Type Description
og.math.Matrix4

setOrtho(left, right, bottom, top, near, far)

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

setPerspective(angle, aspect, near, far)

Creates current percpective projection matrix.
Name Type Description
angle number View angle in degrees.
aspect number Screen aspect ratio.
near number Near clip plane.
far number Far clip plane.

setRotation(u, angle){og.math.Matrix4}

Sets current rotation matrix around the aligned axis and angle.
Name Type Description
u og.math.Vector3 Aligned axis.
angle number Aligned axis angle in radians.
Returns:
Type Description
og.math.Matrix4
Creates an inversed 3x3 matrix of the current.
Returns:
Type Description
og.math.Matrix3
Converts to 3x3 matrix.
Returns:
Type Description
og.math.Matrix3
Add translation vector to the current matrix.
Name Type Description
v og.math.Vector3 Translate vector.
Returns:
Type Description
og.math.Matrix4

translateToPosition(v){og.math.Matrix4}

Sets translation matrix to the position.
Name Type Description
v og.math.Vector3 Translate to position.
Returns:
Type Description
og.math.Matrix4
Creates a trasposed matrix of the current.
Returns:
Type Description
og.math.Matrix4

staticog.math.Matrix4.identity(){og.math.Matrix4}

Returns identity matrix instance.
Returns:
Type Description
og.math.Matrix4