The goog.vec.Mat4 Namespace

.AnyType

@typedef
{goog.vec.AnyType}

.Float32

@typedef
{goog.vec.Float32}

.Float64

@typedef
{goog.vec.Float64}

.Mat4Like

@typedef
{goog.vec.ArrayType}

.Number

@typedef
{goog.vec.Number}

.Type

@typedef
{Float32Array}

.addMat(mat0, mat1, resultMat)

Performs a per-component addition of the matrix mat0 and mat1, storing the result into resultMat.

mat0 {goog.vec.Mat4.AnyType}
The first addend.
mat1 {goog.vec.Mat4.AnyType}
The second addend.
resultMat {goog.vec.Mat4.AnyType}
The matrix to receive the results (may be either mat0 or mat1).
returns {goog.vec.Mat4.AnyType}
return resultMat so that operations can be chained together.

.cloneFloat32

Creates a clone of a 4x4 matrix of Float32.

matrix {goog.vec.Mat4.Float32}
The source 4x4 matrix.
returns {!goog.vec.Mat4.Float32}
The new 4x4 element matrix.

.cloneFloat64

Creates a clone of a 4x4 matrix of Float64.

matrix {goog.vec.Mat4.Float64}
The source 4x4 matrix.
returns {!goog.vec.Mat4.Float64}
The new 4x4 element matrix.

.createFloat32()

Creates the array representation of a 4x4 matrix of Float32. The use of the array directly instead of a class reduces overhead. The returned matrix is cleared to all zeros.

returns {!goog.vec.Mat4.Float32}
The new matrix.

.createFloat32FromArray(matrix)

Creates a 4x4 matrix of Float32 initialized from the given array.

matrix {goog.vec.Mat4.AnyType}
The array containing the matrix values in column major order.
returns {!goog.vec.Mat4.Float32}
The new, 16 element array.

.createFloat32FromValues(v00, v10, v20, v30, v01, v11, v21, v31, v02, v12, v22, v32, v03, v13, v23, v33)

Creates a 4x4 matrix of Float32 initialized from the given values.

v00 {number}
The values at (0, 0).
v10 {number}
The values at (1, 0).
v20 {number}
The values at (2, 0).
v30 {number}
The values at (3, 0).
v01 {number}
The values at (0, 1).
v11 {number}
The values at (1, 1).
v21 {number}
The values at (2, 1).
v31 {number}
The values at (3, 1).
v02 {number}
The values at (0, 2).
v12 {number}
The values at (1, 2).
v22 {number}
The values at (2, 2).
v32 {number}
The values at (3, 2).
v03 {number}
The values at (0, 3).
v13 {number}
The values at (1, 3).
v23 {number}
The values at (2, 3).
v33 {number}
The values at (3, 3).
returns {!goog.vec.Mat4.Float32}
The new, 16 element array.

.createFloat32Identity()

Creates a 4x4 identity matrix of Float32.

returns {!goog.vec.Mat4.Float32}
The new 16 element array.

.createFloat64()

Creates the array representation of a 4x4 matrix of Float64. The returned matrix is cleared to all zeros.

returns {!goog.vec.Mat4.Float64}
The new matrix.

.createFloat64FromArray(matrix)

Creates a 4x4 matrix of Float64 initialized from the given array.

matrix {goog.vec.Mat4.AnyType}
The array containing the matrix values in column major order.
returns {!goog.vec.Mat4.Float64}
The new, nine element array.

.createFloat64FromValues(v00, v10, v20, v30, v01, v11, v21, v31, v02, v12, v22, v32, v03, v13, v23, v33)

Creates a 4x4 matrix of Float64 initialized from the given values.

v00 {number}
The values at (0, 0).
v10 {number}
The values at (1, 0).
v20 {number}
The values at (2, 0).
v30 {number}
The values at (3, 0).
v01 {number}
The values at (0, 1).
v11 {number}
The values at (1, 1).
v21 {number}
The values at (2, 1).
v31 {number}
The values at (3, 1).
v02 {number}
The values at (0, 2).
v12 {number}
The values at (1, 2).
v22 {number}
The values at (2, 2).
v32 {number}
The values at (3, 2).
v03 {number}
The values at (0, 3).
v13 {number}
The values at (1, 3).
v23 {number}
The values at (2, 3).
v33 {number}
The values at (3, 3).
returns {!goog.vec.Mat4.Float64}
The new, 16 element array.

.createFloat64Identity()

Creates a 4x4 identity matrix of Float64.

returns {!goog.vec.Mat4.Float64}
The new 16 element array.

.createNumber()

Creates the array representation of a 4x4 matrix of Number. The returned matrix is cleared to all zeros.

returns {!goog.vec.Mat4.Number}
The new matrix.

.createNumberIdentity()

Creates a 4x4 identity matrix of Number. The returned matrix is cleared to all zeros.

returns {!goog.vec.Mat4.Number}
The new 16 element array.

.determinant(mat)

Computes the determinant of the matrix.

mat {goog.vec.Mat4.AnyType}
The matrix to compute the matrix for.
returns {number}
The determinant of the matrix.

.equals(mat0, mat1)

Returns true if the components of mat0 are equal to the components of mat1.

mat0 {goog.vec.Mat4.AnyType}
The first matrix.
mat1 {goog.vec.Mat4.AnyType}
The second matrix.
returns {boolean}
True if the the two matrices are equivalent.

.getColumn(mat, column, vec)

Retrieves the specified column from the matrix into the given vector.

mat {goog.vec.Mat4.AnyType}
The matrix supplying the values.
column {number}
The column to get the values from.
vec {goog.vec.Vec4.AnyType}
The vector of elements to receive the column.
returns {goog.vec.Vec4.AnyType}
return vec so that operations can be chained together.

.getColumns(mat, vec0, vec1, vec2, vec3)

Retrieves the column values from the given matrix into the given vectors.

mat {goog.vec.Mat4.AnyType}
The matrix supplying the columns.
vec0 {goog.vec.Vec4.AnyType}
The vector to receive column 0.
vec1 {goog.vec.Vec4.AnyType}
The vector to receive column 1.
vec2 {goog.vec.Vec4.AnyType}
The vector to receive column 2.
vec3 {goog.vec.Vec4.AnyType}
The vector to receive column 3.

.getDiagonal(mat, vec, opt_diagonal)

Gets the diagonal values of the matrix into the given vector.

mat {goog.vec.Mat4.AnyType}
The matrix containing the values.
vec {goog.vec.Vec4.AnyType}
The vector to receive the values.
opt_diagonal {number=}
Which diagonal to get. A value of 0 selects the main diagonal, a positive number selects a super diagonal and a negative number selects a sub diagonal.
returns {goog.vec.Vec4.AnyType}
return vec so that operations can be chained together.

.getElement(mat, row, column)

Retrieves the element at the requested row and column.

mat {goog.vec.Mat4.AnyType}
The matrix containing the value to retrieve.
row {number}
The row index.
column {number}
The column index.
returns {number}
The element value at the requested row, column indices.

.getRow(mat, row, vec)

Retrieves the row values into the given vector.

mat {goog.vec.Mat4.AnyType}
The matrix supplying the values.
row {number}
The index of the row supplying the values.
vec {goog.vec.Vec4.AnyType}
The vector to receive the row.
returns {goog.vec.Vec4.AnyType}
return vec so that operations can be chained together.

.getRows(mat, vec0, vec1, vec2, vec3)

Retrieves the rows of the matrix into the supplied vectors.

mat {goog.vec.Mat4.AnyType}
The matrix to supply the values.
vec0 {goog.vec.Vec4.AnyType}
The vector to receive row 0.
vec1 {goog.vec.Vec4.AnyType}
The vector to receive row 1.
vec2 {goog.vec.Vec4.AnyType}
The vector to receive row 2.
vec3 {goog.vec.Vec4.AnyType}
The vector to receive row 3.

.getTranslation(mat, translation)

Retrieves the translation component of the transformation matrix.

mat {goog.vec.Mat4.AnyType}
The transformation matrix.
translation {goog.vec.Vec3.AnyType}
The vector for storing the result.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.invert(mat, resultMat)

Computes the inverse of mat storing the result into resultMat. If the inverse is defined, this function returns true, false otherwise.

mat {goog.vec.Mat4.AnyType}
The matrix to invert.
resultMat {goog.vec.Mat4.AnyType}
The matrix to receive the result (may be mat).
returns {boolean}
True if the inverse is defined. If false is returned, resultMat is not modified.

.makeEulerZXZ(mat, theta1, theta2, theta3)

Makes the given 4x4 matrix a rotation matrix given Euler angles using the ZXZ convention. Given the euler angles [theta1, theta2, theta3], the rotation is defined as rotation = rotation_z(theta1) * rotation_x(theta2) * rotation_z(theta3), with theta1 in [0, 2 * pi], theta2 in [0, pi] and theta3 in [0, 2 * pi]. rotation_x(theta) means rotation around the X axis of theta radians,

mat {goog.vec.Mat4.AnyType}
The matrix.
theta1 {number}
The angle of rotation around the Z axis in radians.
theta2 {number}
The angle of rotation around the X axis in radians.
theta3 {number}
The angle of rotation around the Z axis in radians.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.makeFrustum(mat, left, right, bottom, top, near, far)

Makes the given 4x4 matrix a perspective projection matrix.

mat {goog.vec.Mat4.AnyType}
The matrix.
left {number}
The coordinate of the left clipping plane.
right {number}
The coordinate of the right clipping plane.
bottom {number}
The coordinate of the bottom clipping plane.
top {number}
The coordinate of the top clipping plane.
near {number}
The distance to the near clipping plane.
far {number}
The distance to the far clipping plane.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.makeIdentity(mat)

Makes the given 4x4 matrix the identity matrix.

mat {goog.vec.Mat4.AnyType}
The matrix.
returns {goog.vec.Mat4.AnyType}
return mat so operations can be chained.

.makeLookAt(mat, eyePt, centerPt, worldUpVec)

Makes the given 4x4 matrix a modelview matrix of a camera so that the camera is 'looking at' the given center point.

mat {goog.vec.Mat4.AnyType}
The matrix.
eyePt {goog.vec.Vec3.AnyType}
The position of the eye point (camera origin).
centerPt {goog.vec.Vec3.AnyType}
The point to aim the camera at.
worldUpVec {goog.vec.Vec3.AnyType}
The vector that identifies the up direction for the camera.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.makeOrtho(mat, left, right, bottom, top, near, far)

Makes the given 4x4 matrix an orthographic projection matrix.

mat {goog.vec.Mat4.AnyType}
The matrix.
left {number}
The coordinate of the left clipping plane.
right {number}
The coordinate of the right clipping plane.
bottom {number}
The coordinate of the bottom clipping plane.
top {number}
The coordinate of the top clipping plane.
near {number}
The distance to the near clipping plane.
far {number}
The distance to the far clipping plane.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.makePerspective(mat, fovy, aspect, near, far)

Makse the given 4x4 matrix perspective projection matrix given a field of view and aspect ratio.

mat {goog.vec.Mat4.AnyType}
The matrix.
fovy {number}
The field of view along the y (vertical) axis in radians.
aspect {number}
The x (width) to y (height) aspect ratio.
near {number}
The distance to the near clipping plane.
far {number}
The distance to the far clipping plane.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.makeRotate(mat, angle, ax, ay, az)

Makes the given 4x4 matrix a rotation matrix with the given rotation angle about the axis defined by the vector (ax, ay, az).

mat {goog.vec.Mat4.AnyType}
The matrix.
angle {number}
The rotation angle in radians.
ax {number}
The x component of the rotation axis.
ay {number}
The y component of the rotation axis.
az {number}
The z component of the rotation axis.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.makeRotateX(mat, angle)

Makes the given 4x4 matrix a rotation matrix with the given rotation angle about the X axis.

mat {goog.vec.Mat4.AnyType}
The matrix.
angle {number}
The rotation angle in radians.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.makeRotateY(mat, angle)

Makes the given 4x4 matrix a rotation matrix with the given rotation angle about the Y axis.

mat {goog.vec.Mat4.AnyType}
The matrix.
angle {number}
The rotation angle in radians.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.makeRotateZ(mat, angle)

Makes the given 4x4 matrix a rotation matrix with the given rotation angle about the Z axis.

mat {goog.vec.Mat4.AnyType}
The matrix.
angle {number}
The rotation angle in radians.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.makeScale(mat, x, y, z)

Makes the given 4x4 matrix as a scale matrix with x, y and z scale factors.

mat {goog.vec.Mat4.AnyType}
The matrix.
x {number}
The scale along the x axis.
y {number}
The scale along the y axis.
z {number}
The scale along the z axis.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.makeTranslate(mat, x, y, z)

Makes the given 4x4 matrix a translation matrix with x, y and z translation factors.

mat {goog.vec.Mat4.AnyType}
The matrix.
x {number}
The translation along the x axis.
y {number}
The translation along the y axis.
z {number}
The translation along the z axis.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.makeZero(mat)

Makes the given 4x4 matrix the zero matrix.

mat {goog.vec.Mat4.AnyType}
The matrix.
returns {!goog.vec.Mat4.AnyType}
return mat so operations can be chained.

.multMat(mat0, mat1, resultMat)

Multiplies the two matrices mat0 and mat1 using matrix multiplication, storing the result into resultMat.

mat0 {goog.vec.Mat4.AnyType}
The first (left hand) matrix.
mat1 {goog.vec.Mat4.AnyType}
The second (right hand) matrix.
resultMat {goog.vec.Mat4.AnyType}
The matrix to receive the results (may be either mat0 or mat1).
returns {goog.vec.Mat4.AnyType}
return resultMat so that operations can be chained together.

.multScalar(mat, scalar, resultMat)

Multiplies matrix mat with the given scalar, storing the result into resultMat.

mat {goog.vec.Mat4.AnyType}
The matrix.
scalar {number}
The scalar value to multiply to each element of mat.
resultMat {goog.vec.Mat4.AnyType}
The matrix to receive the results (may be mat).
returns {goog.vec.Mat4.AnyType}
return resultMat so that operations can be chained together.

.multVec3(mat, vec, resultVec)

Transforms the given vector with the given matrix storing the resulting, transformed vector into resultVec. The input vector is multiplied against the upper 3x4 matrix omitting the projective component.

mat {goog.vec.Mat4.AnyType}
The matrix supplying the transformation.
vec {goog.vec.Vec3.AnyType}
The 3 element vector to transform.
resultVec {goog.vec.Vec3.AnyType}
The 3 element vector to receive the results (may be vec).
returns {goog.vec.Vec3.AnyType}
return resultVec so that operations can be chained together.

.multVec3NoTranslate(mat, vec, resultVec)

Transforms the given vector with the given matrix storing the resulting, transformed vector into resultVec. The input vector is multiplied against the upper 3x3 matrix omitting the projective component and translation components.

mat {goog.vec.Mat4.AnyType}
The matrix supplying the transformation.
vec {goog.vec.Vec3.AnyType}
The 3 element vector to transform.
resultVec {goog.vec.Vec3.AnyType}
The 3 element vector to receive the results (may be vec).
returns {goog.vec.Vec3.AnyType}
return resultVec so that operations can be chained together.

.multVec3Projective(mat, vec, resultVec)

Transforms the given vector with the given matrix storing the resulting, transformed vector into resultVec. The input vector is multiplied against the full 4x4 matrix with the homogeneous divide applied to reduce the 4 element vector to a 3 element vector.

mat {goog.vec.Mat4.AnyType}
The matrix supplying the transformation.
vec {goog.vec.Vec3.AnyType}
The 3 element vector to transform.
resultVec {goog.vec.Vec3.AnyType}
The 3 element vector to receive the results (may be vec).
returns {goog.vec.Vec3.AnyType}
return resultVec so that operations can be chained together.

.multVec4(mat, vec, resultVec)

Transforms the given vector with the given matrix storing the resulting, transformed vector into resultVec.

mat {goog.vec.Mat4.AnyType}
The matrix supplying the transformation.
vec {goog.vec.Vec4.AnyType}
The vector to transform.
resultVec {goog.vec.Vec4.AnyType}
The vector to receive the results (may be vec).
returns {goog.vec.Vec4.AnyType}
return resultVec so that operations can be chained together.

.rotate(mat, angle, x, y, z)

Rotate the given matrix by angle about the x,y,z axis. Equivalent to: goog.vec.Mat4.multMat( mat, goog.vec.Mat4.makeRotate(goog.vec.Mat4.create(), angle, x, y, z), mat);

mat {goog.vec.Mat4.AnyType}
The matrix.
angle {number}
The angle in radians.
x {number}
The x component of the rotation axis.
y {number}
The y component of the rotation axis.
z {number}
The z component of the rotation axis.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.rotateX(mat, angle)

Rotate the given matrix by angle about the x axis. Equivalent to: goog.vec.Mat4.multMat( mat, goog.vec.Mat4.makeRotateX(goog.vec.Mat4.create(), angle), mat);

mat {goog.vec.Mat4.AnyType}
The matrix.
angle {number}
The angle in radians.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.rotateY(mat, angle)

Rotate the given matrix by angle about the y axis. Equivalent to: goog.vec.Mat4.multMat( mat, goog.vec.Mat4.makeRotateY(goog.vec.Mat4.create(), angle), mat);

mat {goog.vec.Mat4.AnyType}
The matrix.
angle {number}
The angle in radians.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.rotateZ(mat, angle)

Rotate the given matrix by angle about the z axis. Equivalent to: goog.vec.Mat4.multMat( mat, goog.vec.Mat4.makeRotateZ(goog.vec.Mat4.create(), angle), mat);

mat {goog.vec.Mat4.AnyType}
The matrix.
angle {number}
The angle in radians.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.scale(mat, x, y, z)

Scales the given matrix by x,y,z. Equivalent to: goog.vec.Mat4.multMat( mat, goog.vec.Mat4.makeScale(goog.vec.Mat4.create(), x, y, z), mat);

mat {goog.vec.Mat4.AnyType}
The matrix.
x {number}
The x scale factor.
y {number}
The y scale factor.
z {number}
The z scale factor.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.setColumn(mat, column, vec)

Sets the specified column with the value from the supplied vector.

mat {goog.vec.Mat4.AnyType}
The matrix to receive the values.
column {number}
The column index to set the values on.
vec {goog.vec.Vec4.AnyType}
The vector of elements for the column.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained together.

.setColumnValues(mat, column, v0, v1, v2, v3)

Sets the specified column with the supplied values.

mat {goog.vec.Mat4.AnyType}
The matrix to recieve the values.
column {number}
The column index to set the values on.
v0 {number}
The value for row 0.
v1 {number}
The value for row 1.
v2 {number}
The value for row 2.
v3 {number}
The value for row 3.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained together.

.setColumns(mat, vec0, vec1, vec2, vec3)

Sets the columns of the matrix from the given vectors.

mat {goog.vec.Mat4.AnyType}
The matrix to receive the values.
vec0 {goog.vec.Vec4.AnyType}
The values for column 0.
vec1 {goog.vec.Vec4.AnyType}
The values for column 1.
vec2 {goog.vec.Vec4.AnyType}
The values for column 2.
vec3 {goog.vec.Vec4.AnyType}
The values for column 3.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained together.

.setDiagonal(mat, vec)

Sets the diagonal values of the matrix from the given vector.

mat {goog.vec.Mat4.AnyType}
The matrix to receive the values.
vec {goog.vec.Vec4.AnyType}
The vector containing the values.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained together.

.setDiagonalValues(mat, v00, v11, v22, v33)

Sets the diagonal values of the matrix from the given values.

mat {goog.vec.Mat4.AnyType}
The matrix to receive the values.
v00 {number}
The values for (0, 0).
v11 {number}
The values for (1, 1).
v22 {number}
The values for (2, 2).
v33 {number}
The values for (3, 3).
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained together.

.setElement(mat, row, column, value)

Sets the element at the requested row and column.

mat {goog.vec.Mat4.AnyType}
The matrix to set the value on.
row {number}
The row index.
column {number}
The column index.
value {number}
The value to set at the requested row, column.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained together.

.setFromArray(mat, values)

Sets the matrix from the array of values stored in column major order.

mat {goog.vec.Mat4.AnyType}
The matrix to receive the values.
values {goog.vec.Mat4.AnyType}
The column major ordered array of values to store in the matrix.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained together.

.setFromRowMajorArray(mat, values)

Sets the matrix from the array of values stored in row major order.

mat {goog.vec.Mat4.AnyType}
The matrix to receive the values.
values {goog.vec.Mat4.AnyType}
The row major ordered array of values to store in the matrix.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained together.

.setFromValues(mat, v00, v10, v20, v30, v01, v11, v21, v31, v02, v12, v22, v32, v03, v13, v23, v33)

Initializes the matrix from the set of values. Note the values supplied are in column major order.

mat {goog.vec.Mat4.AnyType}
The matrix to receive the values.
v00 {number}
The values at (0, 0).
v10 {number}
The values at (1, 0).
v20 {number}
The values at (2, 0).
v30 {number}
The values at (3, 0).
v01 {number}
The values at (0, 1).
v11 {number}
The values at (1, 1).
v21 {number}
The values at (2, 1).
v31 {number}
The values at (3, 1).
v02 {number}
The values at (0, 2).
v12 {number}
The values at (1, 2).
v22 {number}
The values at (2, 2).
v32 {number}
The values at (3, 2).
v03 {number}
The values at (0, 3).
v13 {number}
The values at (1, 3).
v23 {number}
The values at (2, 3).
v33 {number}
The values at (3, 3).
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained together.

.setRow(mat, row, vec)

Sets the row values from the supplied vector.

mat {goog.vec.Mat4.AnyType}
The matrix to receive the row values.
row {number}
The index of the row.
vec {goog.vec.Vec4.AnyType}
The vector containing the values.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained together.

.setRowValues(mat, row, v0, v1, v2, v3)

Sets the row values from the supplied values.

mat {goog.vec.Mat4.AnyType}
The matrix to receive the values.
row {number}
The index of the row to receive the values.
v0 {number}
The value for column 0.
v1 {number}
The value for column 1.
v2 {number}
The value for column 2.
v3 {number}
The value for column 3.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained together.

.setRows(mat, vec0, vec1, vec2, vec3)

Sets the rows of the matrix from the supplied vectors.

mat {goog.vec.Mat4.AnyType}
The matrix to receive the values.
vec0 {goog.vec.Vec4.AnyType}
The values for row 0.
vec1 {goog.vec.Vec4.AnyType}
The values for row 1.
vec2 {goog.vec.Vec4.AnyType}
The values for row 2.
vec3 {goog.vec.Vec4.AnyType}
The values for row 3.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained together.

.subMat(mat0, mat1, resultMat)

Performs a per-component subtraction of the matrix mat0 and mat1, storing the result into resultMat.

mat0 {goog.vec.Mat4.AnyType}
The minuend.
mat1 {goog.vec.Mat4.AnyType}
The subtrahend.
resultMat {goog.vec.Mat4.AnyType}
The matrix to receive the results (may be either mat0 or mat1).
returns {goog.vec.Mat4.AnyType}
return resultMat so that operations can be chained together.

.toEulerZXZ(mat, euler, opt_theta2IsNegative)

Decomposes a rotation matrix into Euler angles using the ZXZ convention so that rotation = rotation_z(theta1) * rotation_x(theta2) * rotation_z(theta3), with theta1 in [0, 2 * pi], theta2 in [0, pi] and theta3 in [0, 2 * pi]. rotation_x(theta) means rotation around the X axis of theta radians.

mat {goog.vec.Mat4.AnyType}
The matrix.
euler {goog.vec.Vec3.AnyType}
The ZXZ Euler angles in radians as [theta1, theta2, theta3].
opt_theta2IsNegative {boolean=}
Whether theta2 is in [-pi, 0] instead of the default [0, pi].
returns {goog.vec.Vec4.AnyType}
return euler so that operations can be chained together.

.toLookAt(mat, eyePt, fwdVec, worldUpVec)

Decomposes a matrix into the lookAt vectors eyePt, fwdVec and worldUpVec. The matrix represents the modelview matrix of a camera. It is the inverse of lookAt except for the output of the fwdVec instead of centerPt. The centerPt itself cannot be recovered from a modelview matrix.

mat {goog.vec.Mat4.AnyType}
The matrix.
eyePt {goog.vec.Vec3.AnyType}
The position of the eye point (camera origin).
fwdVec {goog.vec.Vec3.AnyType}
The vector describing where the camera points to.
worldUpVec {goog.vec.Vec3.AnyType}
The vector that identifies the up direction for the camera.
returns {boolean}
True if the method succeeds, false otherwise. The method can only fail if the inverse of viewMatrix is not defined.

.translate(mat, x, y, z)

Translates the given matrix by x,y,z. Equvialent to: goog.vec.Mat4.multMat( mat, goog.vec.Mat4.makeTranslate(goog.vec.Mat4.create(), x, y, z), mat);

mat {goog.vec.Mat4.AnyType}
The matrix.
x {number}
The translation along the x axis.
y {number}
The translation along the y axis.
z {number}
The translation along the z axis.
returns {goog.vec.Mat4.AnyType}
return mat so that operations can be chained.

.transpose(mat, resultMat)

Transposes the given matrix mat storing the result into resultMat.

mat {goog.vec.Mat4.AnyType}
The matrix to transpose.
resultMat {goog.vec.Mat4.AnyType}
The matrix to receive the results (may be mat).
returns {goog.vec.Mat4.AnyType}
return resultMat so that operations can be chained together.