mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
aux/math: Add quat from angle vector function
This commit is contained in:
parent
e3516061bb
commit
21e77b85d7
|
@ -113,6 +113,18 @@ math_vec3_cross(const struct xrt_vec3 *l,
|
|||
*
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Create a rotation from a angle in radians and a vector.
|
||||
*
|
||||
* @relates xrt_quat
|
||||
* @relates xrt_vec3
|
||||
* @ingroup aux_math
|
||||
*/
|
||||
void
|
||||
math_quat_from_angle_vector(float angle_rads,
|
||||
const struct xrt_vec3 *vector,
|
||||
struct xrt_quat *result);
|
||||
|
||||
/*!
|
||||
* Create a rotation from a 3x3 rotation matrix.
|
||||
*
|
||||
|
|
|
@ -89,6 +89,14 @@ math_vec3_cross(const struct xrt_vec3 *l,
|
|||
*
|
||||
*/
|
||||
|
||||
extern "C" void
|
||||
math_quat_from_angle_vector(float angle_rads,
|
||||
const struct xrt_vec3 *vector,
|
||||
struct xrt_quat *result)
|
||||
{
|
||||
map_quat(*result) = Eigen::AngleAxisf(angle_rads, copy(vector));
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
math_quat_from_matrix_3x3(const struct xrt_matrix_3x3 *mat,
|
||||
struct xrt_quat *result)
|
||||
|
|
Loading…
Reference in a new issue