Commit 2b006d5d authored by Ryan Pavlik's avatar Ryan Pavlik Committed by Jakob Bornecrantz
Browse files

aux/math: Add quaternion normalization

parent 46fa9cbd
......@@ -79,6 +79,15 @@ math_vec3_accum(const struct xrt_vec3 *additional, struct xrt_vec3 *inAndOut);
*
*/
/*!
* Normalize a quaternion.
*
* @relates xrt_quat
* @ingroup aux_math
*/
void
math_quat_normalize(struct xrt_quat *inout);
/*!
* Rotate a vector.
*
......
......@@ -70,6 +70,13 @@ math_vec3_accum(const struct xrt_vec3* additional, struct xrt_vec3* inAndOut)
*
*/
void
math_quat_normalize(struct xrt_quat* inout)
{
assert(inout != NULL);
map_quat(*inout).normalize();
}
void
math_quat_rotate(const struct xrt_quat* left,
const struct xrt_quat* right,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment