a/math, comp/main, comp/render: Change math_matrix_2x2_* to m_mat2x2_*

This commit is contained in:
Moses 2023-01-27 12:34:39 -06:00 committed by Moses Turner
parent 7d8d1ad8e7
commit 10cdde859a
3 changed files with 13 additions and 15 deletions

View file

@ -18,9 +18,9 @@ extern "C" {
#endif
static inline void
math_matrix_2x2_multiply(const struct xrt_matrix_2x2 *left,
const struct xrt_matrix_2x2 *right,
struct xrt_matrix_2x2 *result_out)
m_mat2x2_multiply(const struct xrt_matrix_2x2 *left,
const struct xrt_matrix_2x2 *right,
struct xrt_matrix_2x2 *result_out)
{
const struct xrt_matrix_2x2 l = *left;
const struct xrt_matrix_2x2 r = *right;
@ -37,9 +37,7 @@ math_matrix_2x2_multiply(const struct xrt_matrix_2x2 *left,
}
static inline void
math_matrix_2x2_transform_vec2(const struct xrt_matrix_2x2 *left,
const struct xrt_vec2 *right,
struct xrt_vec2 *result_out)
m_mat2x2_transform_vec2(const struct xrt_matrix_2x2 *left, const struct xrt_vec2 *right, struct xrt_vec2 *result_out)
{
const struct xrt_matrix_2x2 l = *left;
const struct xrt_vec2 r = *right;
@ -48,7 +46,7 @@ math_matrix_2x2_transform_vec2(const struct xrt_matrix_2x2 *left,
}
static inline void
math_matrix_2x2_invert(const struct xrt_matrix_2x2 *matrix, struct xrt_matrix_2x2 *invertedMatrix)
m_mat2x2_invert(const struct xrt_matrix_2x2 *matrix, struct xrt_matrix_2x2 *invertedMatrix)
{
float determinant = matrix->v[0] * matrix->v[3] - matrix->v[1] * matrix->v[2];
invertedMatrix->v[0] = matrix->v[3] / determinant;

View file

@ -299,12 +299,12 @@ renderer_build_rendering(struct comp_renderer *r,
}};
if (pre_rotate) {
math_matrix_2x2_multiply(&distortion_data[0].vertex_rot, //
&rotation_90_cw, //
&distortion_data[0].vertex_rot); //
math_matrix_2x2_multiply(&distortion_data[1].vertex_rot, //
&rotation_90_cw, //
&distortion_data[1].vertex_rot); //
m_mat2x2_multiply(&distortion_data[0].vertex_rot, //
&rotation_90_cw, //
&distortion_data[0].vertex_rot); //
m_mat2x2_multiply(&distortion_data[1].vertex_rot, //
&rotation_90_cw, //
&distortion_data[1].vertex_rot); //
}
render_gfx_update_distortion(rr, //

View file

@ -602,7 +602,7 @@ create_and_fill_in_distortion_buffer_for_view(struct vk_bundle *vk,
}};
if (pre_rotate) {
math_matrix_2x2_multiply(&rot, &rotation_90_cw, &rot);
m_mat2x2_multiply(&rot, &rotation_90_cw, &rot);
}
VkDeviceSize size = sizeof(struct texture);
@ -631,7 +631,7 @@ create_and_fill_in_distortion_buffer_for_view(struct vk_bundle *vk,
// These need to go from -0.5 to 0.5 for the rotation
struct xrt_vec2 uv = {u - 0.5f, v - 0.5f};
math_matrix_2x2_transform_vec2(&rot, &uv, &uv);
m_mat2x2_transform_vec2(&rot, &uv, &uv);
uv.x += 0.5f;
uv.y += 0.5f;