...although this can be greatly simplified and optimised with mat4.fromRotationTranslation.
Here's the docs from gl-matrix source code FYI
/**
* Creates a matrix from a quaternion rotation and vector translation
* This is equivalent to (but much faster than):
*
* mat4.identity(dest);
* mat4.translate(dest, vec);
* var quatMat = mat4.create();
* quat4.toMat4(quat, quatMat);
* mat4.multiply(dest, quatMat);
*
* @param {quat4} quat Rotation quaternion
* @param {vec3} vec Translation vector
* @param {mat4} [dest] mat4 receiving operation result. If not specified result is written to a new mat4
*
* @returns {mat4} dest if specified, a new mat4 otherwise
*/
mat4.fromRotationTranslation = function (quat, vec, dest) {
Currently the code is...
...although this can be greatly simplified and optimised with
mat4.fromRotationTranslation
.Here's the docs from gl-matrix source code FYI