added implementation of euler_to_quat_lh and fixed the tests. Now I gotta decide what to name the macros for controlling lefthand and also make call functions for rh and lh conditionally declared

This commit is contained in:
John Choi
2023-12-28 11:01:01 -06:00
parent fa6244c42b
commit aa20b8ae7f
3 changed files with 64 additions and 26 deletions

View File

@@ -23,8 +23,6 @@ TEST_IMPL(GLM_PREFIX, euler_xyz_quat_lh) {
versor result;
versor tmp;
mat4 expected_mat4;
/* 100 randomized tests */
for (int i = 0; i < 100; i++) {
test_rand_vec3(angles);
@@ -213,12 +211,6 @@ TEST_IMPL(GLM_PREFIX, euler_yxz_quat_lh) {
/* verify that it acts the same as rotating by 3 axis quaternions */
ASSERTIFY(test_assert_quat_eq(result, expected))
/* verify that it acts the same as glm_euler_by_order */
glm_euler_by_order(angles, GLM_EULER_YXZ, expected_mat4);
glm_mat4_quat(expected_mat4, expected);
ASSERTIFY(test_assert_quat_eq_abs(result, expected));
}
@@ -252,12 +244,6 @@ TEST_IMPL(GLM_PREFIX, euler_yxz_quat_lh) {
ASSERT(test_eq(glm_quat_norm(result), 1.0f))
ASSERTIFY(test_assert_quat_eq(result, expected))
/* verify that it acts the same as glm_euler_by_order */
glm_euler_by_order(angles, GLM_EULER_YXZ, expected_mat4);
glm_mat4_quat(expected_mat4, expected);
ASSERTIFY(test_assert_quat_eq_abs(result, expected));
}
}
}
@@ -305,12 +291,6 @@ TEST_IMPL(GLM_PREFIX, euler_yzx_quat_lh) {
/* verify that it acts the same as rotating by 3 axis quaternions */
ASSERTIFY(test_assert_quat_eq(result, expected))
/* verify that it acts the same as glm_euler_by_order */
glm_euler_by_order(angles, GLM_EULER_YZX, expected_mat4);
glm_mat4_quat(expected_mat4, expected);
ASSERTIFY(test_assert_quat_eq_abs(result, expected));
}
@@ -344,12 +324,6 @@ TEST_IMPL(GLM_PREFIX, euler_yzx_quat_lh) {
ASSERT(test_eq(glm_quat_norm(result), 1.0f))
ASSERTIFY(test_assert_quat_eq(result, expected))
/* verify that it acts the same as glm_euler_by_order */
glm_euler_by_order(angles, GLM_EULER_YZX, expected_mat4);
glm_mat4_quat(expected_mat4, expected);
ASSERTIFY(test_assert_quat_eq_abs(result, expected));
}
}
}

View File

@@ -40,6 +40,7 @@
#include "test_cam_rh_no.h"
#include "test_cam_rh_zo.h"
#include "test_euler_to_quat_rh.h"
#include "test_euler_to_quat_lh.h"
#undef GLM
#undef GLM_PREFIX
@@ -78,6 +79,7 @@
#include "test_cam_rh_no.h"
#include "test_cam_rh_zo.h"
#include "test_euler_to_quat_rh.h"
#include "test_euler_to_quat_lh.h"
#undef GLM
#undef GLM_PREFIX