goog.vec.Mat4
Functions
Performs a per-component addition of the matrix mat0 and mat1, storing the result into resultMat.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
clone( matrix ) → Float32Array
Float32Array
cloneFloat32( matrix ) → Float32Array
Float32Array
Creates a clone of a 4x4 matrix of Float32.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
cloneFloat64( matrix ) → Float64Array
Float64Array
Creates a clone of a 4x4 matrix of Float64.
Parameters |
| ||||
---|---|---|---|---|---|
Returns |
|
create() → Float32Array
Float32Array
Creates the array representation of a 4x4 matrix of Float32. The returned matrix is cleared to all zeros.
warning Deprecated | Use createFloat32. |
---|
Parameters | None. | ||
---|---|---|---|
Returns |
|
createFloat32() → Float32Array
Float32Array
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.
Parameters | None. | ||
---|---|---|---|
Returns |
|
createFloat32FromArray( matrix ) → Float32Array
Float32Array
createFloat32FromValues( v00, v10, v20, v30, v01, v11, v21, v31, v02, v12, v22, v32, v03, v13, v23, v33 ) → Float32Array
Float32Array
Creates a 4x4 matrix of Float32 initialized from the given values.
Parameters |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
createFloat32Identity() → Float32Array
Float32Array
Creates a 4x4 identity matrix of Float32.
Parameters | None. | ||
---|---|---|---|
Returns |
|
createFloat64() → Float64Array
Float64Array
Creates the array representation of a 4x4 matrix of Float64. The returned matrix is cleared to all zeros.
Parameters | None. | ||
---|---|---|---|
Returns |
|
createFloat64FromArray( matrix ) → Float64Array
Float64Array
createFloat64FromValues( v00, v10, v20, v30, v01, v11, v21, v31, v02, v12, v22, v32, v03, v13, v23, v33 ) → Float64Array
Float64Array
Creates a 4x4 matrix of Float64 initialized from the given values.
Parameters |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
createFloat64Identity() → Float64Array
Float64Array
Creates a 4x4 identity matrix of Float64.
Parameters | None. | ||
---|---|---|---|
Returns |
|
createFromArray( matrix ) → Float32Array
Float32Array
createFromValues( v00, v10, v20, v30, v01, v11, v21, v31, v02, v12, v22, v32, v03, v13, v23, v33 ) → Float32Array
Float32Array
Creates a 4x4 matrix of Float32 initialized from the given values.
warning Deprecated | Use createFloat32FromValues. |
---|
Parameters |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
createIdentity() → Float32Array
Float32Array
Creates the array representation of a 4x4 matrix of Float32. The returned matrix is cleared to all zeros.
warning Deprecated | Use createFloat32Identity. |
---|
Parameters | None. | ||
---|---|---|---|
Returns |
|
determinant( mat ) → number
number
equals( mat0, mat1 ) → boolean
boolean
Retrieves the specified column from the matrix into the given vector.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
getColumns( mat, vec0, vec1, vec2, vec3 ) → void
void
Retrieves the column values from the given matrix into the given vectors.
Parameters |
|
---|
Gets the diagonal values of the matrix into the given vector.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
getElement( mat, row, column ) → number
number
Retrieves the row values into the given vector.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
getRows( mat, vec0, vec1, vec2, vec3 ) → void
void
Retrieves the rows of the matrix into the supplied vectors.
Parameters |
|
---|
Retrieves the translation component of the transformation matrix.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
invert( mat, resultMat ) → boolean
boolean
Computes the inverse of mat storing the result into resultMat. If the inverse is defined, this function returns true, false otherwise.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
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,
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Makes the given 4x4 matrix a perspective projection matrix.
Parameters |
| ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Makes the given 4x4 matrix a modelview matrix of a camera so that the camera is 'looking at' the given center point.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Makes the given 4x4 matrix an orthographic projection matrix.
Parameters |
| ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Makes the given 4x4 matrix perspective projection matrix given a field of view and aspect ratio.
Parameters |
| ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Makes the given 4x4 matrix a rotation matrix with the given rotation angle about the axis defined by the vector (ax, ay, az).
Parameters |
| ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Makes the given 4x4 matrix as a scale matrix with x, y and z scale factors.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Makes the given 4x4 matrix a translation matrix with x, y and z translation factors.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Multiplies the two matrices mat0 and mat1 using matrix multiplication, storing the result into resultMat.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Multiplies matrix mat with the given scalar, storing the result into resultMat.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
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.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
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.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
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.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Transforms the given vector with the given matrix storing the resulting, transformed vector into resultVec.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
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);
Parameters |
| ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
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);
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
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);
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
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);
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
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);
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Sets the specified column with the value from the supplied vector.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Sets the specified column with the supplied values.
Parameters |
| ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Sets the columns of the matrix from the given vectors.
Parameters |
| ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Sets the diagonal values of the matrix from the given vector.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
Sets the diagonal values of the matrix from the given values.
Parameters |
| ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Sets the element at the requested row and column.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Sets the matrix from the array of values stored in column major order.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
Sets the matrix from the array of values stored in row major order.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
Initializes the matrix from the set of values. Note the values supplied are in column major order.
Parameters |
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Sets the row values from the supplied vector.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Sets the row values from the supplied values.
Parameters |
| ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Sets the rows of the matrix from the supplied vectors.
Parameters |
| ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Performs a per-component subtraction of the matrix mat0 and mat1, storing the result into resultMat.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
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.
Parameters |
| ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
toLookAt( mat, eyePt, fwdVec, worldUpVec ) → boolean
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.
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
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);
Parameters |
| ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns |
|
Transposes the given matrix mat storing the result into resultMat.
Parameters |
| ||||||||
---|---|---|---|---|---|---|---|---|---|
Returns |
|
Properties
No information.
Float32 → Float32Array
Float32Array
No information.
Float64 → Float64Array
Float64Array
No information.
No information.
No information.
Type → Float32Array
Float32Array
No information.