Home

# Library goog.vec.Mat4

Function Summary
| `addMat(?goog.vec.Mat4.AnyType mat0, ?goog.vec.Mat4.AnyType mat1, ?goog.vec.Mat4.AnyType resultMat) ⇒ !goog.vec.Mat4.AnyType` Performs a per-component addition of the matrix mat0 and mat1, storing the result into resultMat.
| `create() ⇒ !goog.vec.Mat4.Type` Creates the array representation of a 4x4 matrix of Float32. The returned matrix is cleared to all zeros.
| `createFloat32() ⇒ !goog.vec.Mat4.Float32` 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.
| `createFloat32FromArray(?goog.vec.Mat4.AnyType matrix) ⇒ !goog.vec.Mat4.Float32` Creates a 4x4 matrix of Float32 initialized from the given array.
| `createFloat32FromValues(number v00, number v10, number v20, number v30, number v01, number v11, number v21, number v31, number v02, number v12, number v22, number v32, number v03, number v13, number v23, number v33) ⇒ !goog.vec.Mat4.Float32` Creates a 4x4 matrix of Float32 initialized from the given values.
| `createFloat32Identity() ⇒ !goog.vec.Mat4.Float32` Creates a 4x4 identity matrix of Float32.
| `createFloat64() ⇒ !goog.vec.Mat4.Float64` Creates the array representation of a 4x4 matrix of Float64. The returned matrix is cleared to all zeros.
| `createFloat64FromArray(?goog.vec.Mat4.AnyType matrix) ⇒ !goog.vec.Mat4.Float64` Creates a 4x4 matrix of Float64 initialized from the given array.
| `createFloat64FromValues(number v00, number v10, number v20, number v30, number v01, number v11, number v21, number v31, number v02, number v12, number v22, number v32, number v03, number v13, number v23, number v33) ⇒ !goog.vec.Mat4.Float64` Creates a 4x4 matrix of Float64 initialized from the given values.
| `createFloat64Identity() ⇒ !goog.vec.Mat4.Float64` Creates a 4x4 identity matrix of Float64.
| `createFromArray(?goog.vec.Mat4.Mat4Like matrix) ⇒ !goog.vec.Mat4.Type` Creates a 4x4 matrix of Float32 initialized from the given array.
| `createFromValues(number v00, number v10, number v20, number v30, number v01, number v11, number v21, number v31, number v02, number v12, number v22, number v32, number v03, number v13, number v23, number v33) ⇒ !goog.vec.Mat4.Type` Creates a 4x4 matrix of Float32 initialized from the given values.
| `createIdentity() ⇒ !goog.vec.Mat4.Type` Creates the array representation of a 4x4 matrix of Float32. The returned matrix is cleared to all zeros.
| `createNumber() ⇒ !goog.vec.Mat4.Number` Creates the array representation of a 4x4 matrix of Number. The returned matrix is cleared to all zeros.
| `createNumberIdentity() ⇒ !goog.vec.Mat4.Number` Creates a 4x4 identity matrix of Number. The returned matrix is cleared to all zeros.
| `determinant(?goog.vec.Mat4.AnyType mat) ⇒ number` Computes the determinant of the matrix.
| `equals(?goog.vec.Mat4.AnyType mat0, ?goog.vec.Mat4.AnyType mat1) ⇒ boolean` Returns true if the components of mat0 are equal to the components of mat1.
| `getColumn(?goog.vec.Mat4.AnyType mat, number column, ?goog.vec.Vec4.AnyType vec)` Retrieves the specified column from the matrix into the given vector.
| `getColumns(?goog.vec.Mat4.AnyType mat, ?goog.vec.Vec4.AnyType vec0, ?goog.vec.Vec4.AnyType vec1, ?goog.vec.Vec4.AnyType vec2, ?goog.vec.Vec4.AnyType vec3)` Retrieves the column values from the given matrix into the given vectors.
| `getDiagonal(?goog.vec.Mat4.AnyType mat, ?goog.vec.Vec4.AnyType vec, number= opt_diagonal)` Gets the diagonal values of the matrix into the given vector.
| `getElement(?goog.vec.Mat4.AnyType mat, number row, number column) ⇒ number` Retrieves the element at the requested row and column.
| `getRow(?goog.vec.Mat4.AnyType mat, number row, ?goog.vec.Vec4.AnyType vec)` Retrieves the row values into the given vector.
| `getRows(?goog.vec.Mat4.AnyType mat, ?goog.vec.Vec4.AnyType vec0, ?goog.vec.Vec4.AnyType vec1, ?goog.vec.Vec4.AnyType vec2, ?goog.vec.Vec4.AnyType vec3)` Retrieves the rows of the matrix into the supplied vectors.
| `invert(?goog.vec.Mat4.AnyType mat, ?goog.vec.Mat4.AnyType resultMat) ⇒ boolean` Computes the inverse of mat storing the result into resultMat. If the inverse is defined, this function returns true, false otherwise.

`makeEulerZXZ(!goog.vec.Mat4.AnyType mat, number theta1, number theta2, number theta3) ⇒ !goog.vec.Mat4.AnyType`

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,

| `makeFrustum(?goog.vec.Mat4.AnyType mat, number left, number right, number bottom, number top, number near, number far) ⇒ ?goog.vec.Mat4.AnyType` Makes the given 4x4 matrix a perspective projection matrix.
| `makeIdentity(?goog.vec.Mat4.AnyType mat) ⇒ !goog.vec.Mat4.AnyType` Makes the given 4x4 matrix the identity matrix.
| `makeLookAt(?goog.vec.Mat4.AnyType mat, ?goog.vec.Vec3.AnyType eyePt, ?goog.vec.Vec3.AnyType centerPt, ?goog.vec.Vec3.AnyType worldUpVec) ⇒ ?goog.vec.Mat4.AnyType` Makes the given 4x4 matrix a modelview matrix of a camera so that the camera is 'looking at' the given center point.
| `makeOrtho(!goog.vec.Mat4.AnyType mat, number left, number right, number bottom, number top, number near, number far) ⇒ !goog.vec.Mat4.AnyType` Makes the given 4x4 matrix an orthographic projection matrix.
| `makePerspective(?goog.vec.Mat4.AnyType mat, number fovy, number aspect, number near, number far) ⇒ ?goog.vec.Mat4.AnyType` Makse the given 4x4 matrix perspective projection matrix given a field of view and aspect ratio.
| `makeRotate(?goog.vec.Mat4.AnyType mat, number angle, number ax, number ay, number az) ⇒ ?goog.vec.Mat4.AnyType` Makes the given 4x4 matrix a rotation matrix with the given rotation angle about the axis defined by the vector (ax, ay, az).
| `makeScale(?goog.vec.Mat4.AnyType mat, number x, number y, number z) ⇒ ?goog.vec.Mat4.AnyType` Makes the given 4x4 matrix as a scale matrix with x, y and z scale factors.
| `makeTranslate(?goog.vec.Mat4.AnyType mat, number x, number y, number z) ⇒ ?goog.vec.Mat4.AnyType` Makes the given 4x4 matrix a translation matrix with x, y and z translation factors.
| `makeZero(?goog.vec.Mat4.AnyType mat) ⇒ !goog.vec.Mat4.AnyType` Makes the given 4x4 matrix the zero matrix.
| `multMat(?goog.vec.Mat4.AnyType mat0, ?goog.vec.Mat4.AnyType mat1, ?goog.vec.Mat4.AnyType resultMat) ⇒ !goog.vec.Mat4.AnyType` Multiplies the two matrices mat0 and mat1 using matrix multiplication, storing the result into resultMat.
| `multScalar(?goog.vec.Mat4.AnyType mat, number scalar, ?goog.vec.Mat4.AnyType resultMat) ⇒ !goog.vec.Mat4.AnyType` Multiplies matrix mat with the given scalar, storing the result into resultMat.
| `multVec3(?goog.vec.Mat4.AnyType mat, ?goog.vec.Vec3.AnyType vec, ?goog.vec.Vec3.AnyType resultVec) ⇒ !goog.vec.Vec3.AnyType` 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.
| `multVec3NoTranslate(?goog.vec.Mat4.AnyType mat, ?goog.vec.Vec3.AnyType vec, ?goog.vec.Vec3.AnyType resultVec) ⇒ !goog.vec.Vec3.AnyType` 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.
| `multVec3Projective(?goog.vec.Mat4.AnyType mat, ?goog.vec.Vec3.AnyType vec, ?goog.vec.Vec3.AnyType resultVec) ⇒ !goog.vec.Vec3.AnyType` 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.
| `multVec4(?goog.vec.Mat4.AnyType mat, ?goog.vec.Vec4.AnyType vec, ?goog.vec.Vec4.AnyType resultVec) ⇒ !goog.vec.Vec4.AnyType` Transforms the given vector with the given matrix storing the resulting, transformed vector into resultVec.
| `rotate(?goog.vec.Mat4.AnyType mat, number angle, number x, number y, number z) ⇒ ?goog.vec.Mat4.AnyType` Rotation 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);
| `scale(?goog.vec.Mat4.AnyType mat, number x, number y, number z) ⇒ ?goog.vec.Mat4.AnyType` 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);
| `setColumn(?goog.vec.Mat4.AnyType mat, number column, ?goog.vec.Vec4.AnyType vec)` Sets the specified column with the value from the supplied vector.
| `setColumnValues(?goog.vec.Mat4.AnyType mat, number column, number v0, number v1, number v2, number v3)` Sets the specified column with the supplied values.
| `setColumns(?goog.vec.Mat4.AnyType mat, ?goog.vec.Vec4.AnyType vec0, ?goog.vec.Vec4.AnyType vec1, ?goog.vec.Vec4.AnyType vec2, ?goog.vec.Vec4.AnyType vec3)` Sets the columns of the matrix from the given vectors.
| `setDiagonal(?goog.vec.Mat4.AnyType mat, ?goog.vec.Vec4.AnyType vec)` Sets the diagonal values of the matrix from the given vector.
| `setDiagonalValues(?goog.vec.Mat4.AnyType mat, number v00, number v11, number v22, number v33)` Sets the diagonal values of the matrix from the given values.
| `setElement(?goog.vec.Mat4.AnyType mat, number row, number column, number value)` Sets the element at the requested row and column.
| `setFromArray(?goog.vec.Mat4.AnyType mat, ?goog.vec.Mat4.AnyType values)` Sets the matrix from the array of values stored in column major order.
| `setFromRowMajorArray(?goog.vec.Mat4.AnyType mat, ?goog.vec.Mat4.AnyType values)` Sets the matrix from the array of values stored in row major order.
| `setFromValues(?goog.vec.Mat4.AnyType mat, number v00, number v10, number v20, number v30, number v01, number v11, number v21, number v31, number v02, number v12, number v22, number v32, number v03, number v13, number v23, number v33)` Initializes the matrix from the set of values. Note the values supplied are in column major order.
| `setRow(?goog.vec.Mat4.AnyType mat, number row, ?goog.vec.Vec4.AnyType vec)` Sets the row values from the supplied vector.
| `setRowValues(?goog.vec.Mat4.AnyType mat, number row, number v0, number v1, number v2, number v3)` Sets the row values from the supplied values.
| `setRows(?goog.vec.Mat4.AnyType mat, ?goog.vec.Vec4.AnyType vec0, ?goog.vec.Vec4.AnyType vec1, ?goog.vec.Vec4.AnyType vec2, ?goog.vec.Vec4.AnyType vec3)` Sets the rows of the matrix from the supplied vectors.
| `subMat(?goog.vec.Mat4.AnyType mat0, ?goog.vec.Mat4.AnyType mat1, ?goog.vec.Mat4.AnyType resultMat) ⇒ !goog.vec.Mat4.AnyType` Performs a per-component subtraction of the matrix mat0 and mat1, storing the result into resultMat.
| `toEulerZXZ(?goog.vec.Mat4.AnyType mat, ?goog.vec.Mat4.AnyType euler, boolean= 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.

`toLookAt(?goog.vec.Mat4.AnyType mat, ?goog.vec.Vec3.AnyType eyePt, ?goog.vec.Vec3.AnyType fwdVec, ?goog.vec.Vec3.AnyType worldUpVec) ⇒ boolean`

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.

| `translate(?goog.vec.Mat4.AnyType mat, number x, number y, number z) ⇒ ?goog.vec.Mat4.AnyType` 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);
| `transpose(?goog.vec.Mat4.AnyType mat, ?goog.vec.Mat4.AnyType resultMat) ⇒ !goog.vec.Mat4.AnyType` Transposes the given matrix mat storing the result into resultMat.