mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-04 06:06:17 +00:00
a/math: Add math_matrix_3x3_identity()
Add an initialisation function to set a 3x3 matrix to the identity matrix.
This commit is contained in:
parent
971739627a
commit
bb5aa35c00
|
@ -318,6 +318,15 @@ math_matrix_2x2_multiply(const struct xrt_matrix_2x2 *left,
|
||||||
const struct xrt_matrix_2x2 *right,
|
const struct xrt_matrix_2x2 *right,
|
||||||
struct xrt_matrix_2x2 *result_out);
|
struct xrt_matrix_2x2 *result_out);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Initialize a 3x3 matrix to the identity matrix
|
||||||
|
*
|
||||||
|
* @see xrt_matrix_3x3
|
||||||
|
* @ingroup aux_math
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
math_matrix_3x3_identity(struct xrt_matrix_3x3 *mat);
|
||||||
|
|
||||||
void
|
void
|
||||||
math_matrix_3x3_transform_vec3(const struct xrt_matrix_3x3 *left,
|
math_matrix_3x3_transform_vec3(const struct xrt_matrix_3x3 *left,
|
||||||
const struct xrt_vec3 *right,
|
const struct xrt_vec3 *right,
|
||||||
|
|
|
@ -364,6 +364,12 @@ math_matrix_2x2_multiply(const struct xrt_matrix_2x2 *left,
|
||||||
*result_out = result;
|
*result_out = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" void
|
||||||
|
math_matrix_3x3_identity(struct xrt_matrix_3x3 *mat)
|
||||||
|
{
|
||||||
|
mat->v[0] = mat->v[4] = mat->v[8] = 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" void
|
extern "C" void
|
||||||
math_matrix_3x3_transform_vec3(const struct xrt_matrix_3x3 *left,
|
math_matrix_3x3_transform_vec3(const struct xrt_matrix_3x3 *left,
|
||||||
const struct xrt_vec3 *right,
|
const struct xrt_vec3 *right,
|
||||||
|
|
Loading…
Reference in a new issue