Decomposes a transformation matrix into its rotation, translation
and scale components. Returns only the rotation component
@param {quat} out_r Quaternion to receive the rotation component
@param {vec3} out_t Vector to receive the translation vector
@param {vec3} out_s Vector to receive the scaling factor
@param {ReadonlyMat4} mat Matrix to be decomposed (input)
@returns {quat} out_r
Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin
This is equivalent to (but much faster than):
Returns a quaternion representing the rotational component
of a transformation matrix. If a matrix is built with
fromRotationTranslation, the returned quaternion will be the
same as the quaternion originally supplied.
@param {quat} out Quaternion to receive the rotation component
@param {ReadonlyMat4} mat Matrix to be decomposed (input)
@return {quat} out
Returns the scaling factor component of a transformation
matrix. If a matrix is built with fromRotationTranslationScale
with a normalized Quaternion paramter, the returned vector will be
the same as the scaling vector
originally supplied.
@param {vec3} out Vector to receive scaling factor component
@param {ReadonlyMat4} mat Matrix to be decomposed (input)
@return {vec3} out
Returns the translation vector component of a transformation
matrix. If a matrix is built with fromRotationTranslation,
the returned vector will be the same as the translation vector
originally supplied.
@param {vec3} out Vector to receive translation component
@param {ReadonlyMat4} mat Matrix to be decomposed (input)
@return {vec3} out
Generates a look-at matrix with the given eye position, focal point, and up axis.
If you want a matrix that actually makes an object look at another object, you should use targetTo instead.
Generates a orthogonal projection matrix with the given bounds.
The near/far clip planes correspond to a normalized device coordinate Z range of -1, 1,
which matches WebGL/OpenGL's clip volume.
Generates a orthogonal projection matrix with the given bounds.
The near/far clip planes correspond to a normalized device coordinate Z range of 0, 1,
which matches WebGPU/Vulkan/DirectX/Metal's clip volume.
Generates a perspective projection matrix with the given field of view.
This is primarily useful for generating projection matrices to be used
with the still experiemental WebVR API.
Generates a perspective projection matrix with the given bounds.
The near/far clip planes correspond to a normalized device coordinate Z range of -1, 1,
which matches WebGL/OpenGL's clip volume.
Passing null/undefined/no value for far will generate infinite projection matrix.
Generates a perspective projection matrix suitable for WebGPU with the given bounds.
The near/far clip planes correspond to a normalized device coordinate Z range of 0, 1,
which matches WebGPU/Vulkan/DirectX/Metal's clip volume.
Passing null/undefined/no value for far will generate infinite projection matrix.