mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-03-04 05:36:58 +00:00
a/math: Add math_vec3_normalize.
This commit is contained in:
parent
7c8febd03d
commit
87a5c425cf
src/xrt/auxiliary/math
|
@ -106,6 +106,16 @@ math_vec3_cross(const struct xrt_vec3 *l,
|
|||
const struct xrt_vec3 *r,
|
||||
struct xrt_vec3 *result);
|
||||
|
||||
|
||||
/*!
|
||||
* Normalize a vec3 in place.
|
||||
*
|
||||
* @relates xrt_vec3
|
||||
* @ingroup aux_math
|
||||
*/
|
||||
void
|
||||
math_vec3_normalize(struct xrt_vec3 *in);
|
||||
|
||||
/*
|
||||
*
|
||||
* Quat functions.
|
||||
|
|
|
@ -94,6 +94,11 @@ math_vec3_cross(const struct xrt_vec3 *l,
|
|||
map_vec3(*result) = map_vec3(*l).cross(map_vec3(*r));
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
math_vec3_normalize(struct xrt_vec3 *in)
|
||||
{
|
||||
map_vec3(*in) = map_vec3(*in).normalized();
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue