# Class: Mat4

## og/math/Mat4~Mat4

#### new Mat4()

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

#### clone(){og.Mat4}

Duplicates a Matrix3 instance.
Type Description
og.Mat4

#### copy(a){og.Mat4}

Copy matrix.
Name Type Description
`a` og.Mat3 Matrix to copy.
Type Description
og.Mat4

#### eulerToMatrix(ax, ay, az){og.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.
Type Description
og.Mat4

#### inverseTo(){og.Mat4}

Creates an inversed matrix of the current.
Type Description
og.Mat4

#### mul(mx){og.Mat4}

Computes the product of two matrices.
Name Type Description
`mx` og.Mat4 Matrix to multiply.
Type Description
og.Mat4

#### mulVec3(p){og.Vec3}

Multiply to 3d vector.
Name Type Description
`p` og.Vec3 3d vector.
Type Description
og.Vec3

#### mulVec4(p){og.Vec4}

Multiply to 4d vector.
Name Type Description
`p` og.Vec4 4d vector.
Type Description
og.Vec4

#### rotate(u, angle){og.Mat4}

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

#### rotateBetweenVectors(a, b){og.Mat4}

Gets the rotation matrix from one vector to another.
Name Type Description
`a` og.Vec3 Firtst vector.
`b` og.Vec3 Second vector.
Type Description
og.Mat4

#### scale(v){og.Mat4}

Scale current matrix to the vector values.
Name Type Description
`v` og.Vec3 Scale vector.
Type Description
og.Mat4

#### set(m){og.Mat4}

Sets column-major order array matrix.
Name Type Description
`m` Array.<number> Matrix array.
Type Description
og.Mat4

#### setFrustum(left, right, bottom, top, near, far){og.Mat4}

Sets perspective projection matrix frustum values.
Name Type Description
`left` number
`right` number
`bottom` number
`top` number
`near` number
`far` number
Type Description
og.Mat4

#### setIdentity(){og.Mat4}

Sets matrix to identity.
Type Description
og.Mat4

#### 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.Mat4}

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

#### toInverseMatrix3(){og.Mat3}

Creates an inversed 3x3 matrix of the current.
Type Description
og.Mat3

#### toMatrix3(){og.Mat3}

Converts to 3x3 matrix.
Type Description
og.Mat3

#### translate(v){og.Mat4}

Add translation vector to the current matrix.
Name Type Description
`v` og.Vec3 Translate vector.
Type Description
og.Mat4

#### translateToPosition(v){og.Mat4}

Sets translation matrix to the position.
Name Type Description
`v` og.Vec3 Translate to position.
Type Description
og.Mat4

#### transposeTo(){og.Mat4}

Creates a trasposed matrix of the current.
Type Description
og.Mat4

#### staticmodule:og/math/Mat4~Mat4.identity(){og.Mat4}

Returns identity matrix instance.
Type Description
og.Mat4