mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-01 12:46:12 +00:00
a/math: Organize base and api file [NFC]
This commit is contained in:
parent
017834c8ad
commit
50b5e6445e
|
@ -154,15 +154,6 @@ math_vec3_scalar_mul(float scalar, struct xrt_vec3 *inAndOut);
|
|||
void
|
||||
math_vec3_cross(const struct xrt_vec3 *l, const struct xrt_vec3 *r, struct xrt_vec3 *result);
|
||||
|
||||
/*!
|
||||
* Cross product of a vector.
|
||||
*
|
||||
* @relates xrt_vec3
|
||||
* @ingroup aux_math
|
||||
*/
|
||||
void
|
||||
math_vec3_f64_cross(const struct xrt_vec3_f64 *l, const struct xrt_vec3_f64 *r, struct xrt_vec3_f64 *result);
|
||||
|
||||
/*!
|
||||
* Get translation vector from isometry matrix (col-major).
|
||||
*
|
||||
|
@ -181,15 +172,32 @@ math_vec3_translation_from_isometry(const struct xrt_matrix_4x4 *isometry, struc
|
|||
void
|
||||
math_vec3_normalize(struct xrt_vec3 *in);
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* 64 bit vector functions.
|
||||
*
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Cross product of a vec3_f64.
|
||||
*
|
||||
* @relates xrt_vec3_f64
|
||||
* @ingroup aux_math
|
||||
*/
|
||||
void
|
||||
math_vec3_f64_cross(const struct xrt_vec3_f64 *l, const struct xrt_vec3_f64 *r, struct xrt_vec3_f64 *result);
|
||||
|
||||
/*!
|
||||
* Normalize a vec3_f64 in place.
|
||||
*
|
||||
* @relates xrt_vec3
|
||||
* @relates xrt_vec3_f64
|
||||
* @ingroup aux_math
|
||||
*/
|
||||
void
|
||||
math_vec3_f64_normalize(struct xrt_vec3_f64 *in);
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Quat functions.
|
||||
|
|
|
@ -172,12 +172,33 @@ math_vec3_normalize(struct xrt_vec3 *in)
|
|||
map_vec3(*in) = map_vec3(*in).normalized();
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
math_vec3_translation_from_isometry(const struct xrt_matrix_4x4 *transform, struct xrt_vec3 *result)
|
||||
{
|
||||
Eigen::Isometry3f isometry{map_matrix_4x4(*transform)};
|
||||
map_vec3(*result) = isometry.translation();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Exported 64 bit vector functions.
|
||||
*
|
||||
*/
|
||||
|
||||
extern "C" void
|
||||
math_vec3_f64_cross(const struct xrt_vec3_f64 *l, const struct xrt_vec3_f64 *r, struct xrt_vec3_f64 *result)
|
||||
{
|
||||
map_vec3_f64(*result) = map_vec3_f64(*l).cross(map_vec3_f64(*r));
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
math_vec3_f64_normalize(struct xrt_vec3_f64 *in)
|
||||
{
|
||||
map_vec3_f64(*in) = map_vec3_f64(*in).normalized();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* Exported quaternion functions.
|
||||
|
@ -789,19 +810,6 @@ m_mat4_f64_multiply(const struct xrt_matrix_4x4_f64 *left,
|
|||
map_matrix_4x4_f64(*result) = l * r;
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
math_vec3_f64_cross(const struct xrt_vec3_f64 *l, const struct xrt_vec3_f64 *r, struct xrt_vec3_f64 *result)
|
||||
{
|
||||
map_vec3_f64(*result) = map_vec3_f64(*l).cross(map_vec3_f64(*r));
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
math_vec3_translation_from_isometry(const struct xrt_matrix_4x4 *transform, struct xrt_vec3 *result)
|
||||
{
|
||||
Eigen::Isometry3f isometry{map_matrix_4x4(*transform)};
|
||||
map_vec3(*result) = isometry.translation();
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
m_mat4_f64_orientation(const struct xrt_quat *quat, struct xrt_matrix_4x4_f64 *result)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue