mirror of
https://github.com/recp/cglm.git
synced 2025-12-31 20:56:07 +00:00
made quat struct and also exported it
This commit is contained in:
@@ -121,7 +121,6 @@ TEST_IMPL(GLM_PREFIX, quatv) {
|
||||
TEST_SUCCESS
|
||||
}
|
||||
|
||||
// telephone001 changes (remove comment when done) TODO
|
||||
TEST_IMPL(GLM_PREFIX, euler_xyz_quat) {
|
||||
for (int i = 0; i < 100; i++) {
|
||||
/*random angles for testing*/
|
||||
@@ -154,8 +153,12 @@ TEST_IMPL(GLM_PREFIX, euler_xyz_quat) {
|
||||
/*use my function to get the quaternion*/
|
||||
glm_euler_xyz_quat(result, angles);
|
||||
|
||||
/*verify if the magnitude of the quaternion stays 1*/
|
||||
ASSERT(test_eq(glm_quat_norm(result), 1.0f))
|
||||
|
||||
ASSERTIFY(test_assert_quat_eq(result, expected))
|
||||
}
|
||||
|
||||
|
||||
/*Start gimbal lock tests*/
|
||||
for (float x = -90.0f; x <= 90.0f; x += 90.0f) {
|
||||
@@ -189,6 +192,9 @@ TEST_IMPL(GLM_PREFIX, euler_xyz_quat) {
|
||||
/*use my function to get the quaternion*/
|
||||
glm_euler_xyz_quat(result, angles);
|
||||
|
||||
/*verify if the magnitude of the quaternion stays 1*/
|
||||
ASSERT(test_eq(glm_quat_norm(result), 1.0f))
|
||||
|
||||
ASSERTIFY(test_assert_quat_eq(result, expected))
|
||||
}
|
||||
}
|
||||
@@ -228,6 +234,9 @@ TEST_IMPL(GLM_PREFIX, euler_xzy_quat) {
|
||||
/*use my function to get the quaternion*/
|
||||
glm_euler_xzy_quat(result, angles);
|
||||
|
||||
/*verify if the magnitude of the quaternion stays 1*/
|
||||
ASSERT(test_eq(glm_quat_norm(result), 1.0f))
|
||||
|
||||
ASSERTIFY(test_assert_quat_eq(result, expected))
|
||||
}
|
||||
|
||||
@@ -263,6 +272,9 @@ TEST_IMPL(GLM_PREFIX, euler_xzy_quat) {
|
||||
/*use my function to get the quaternion*/
|
||||
glm_euler_xzy_quat(result, angles);
|
||||
|
||||
/*verify if the magnitude of the quaternion stays 1*/
|
||||
ASSERT(test_eq(glm_quat_norm(result), 1.0f))
|
||||
|
||||
ASSERTIFY(test_assert_quat_eq(result, expected))
|
||||
}
|
||||
}
|
||||
@@ -303,6 +315,9 @@ TEST_IMPL(GLM_PREFIX, euler_yxz_quat) {
|
||||
/*use my function to get the quaternion*/
|
||||
glm_euler_yxz_quat(result, angles);
|
||||
|
||||
/*verify if the magnitude of the quaternion stays 1*/
|
||||
ASSERT(test_eq(glm_quat_norm(result), 1.0f))
|
||||
|
||||
ASSERTIFY(test_assert_quat_eq(result, expected))
|
||||
}
|
||||
|
||||
@@ -338,6 +353,9 @@ TEST_IMPL(GLM_PREFIX, euler_yxz_quat) {
|
||||
/*use my function to get the quaternion*/
|
||||
glm_euler_yxz_quat(result, angles);
|
||||
|
||||
/*verify if the magnitude of the quaternion stays 1*/
|
||||
ASSERT(test_eq(glm_quat_norm(result), 1.0f))
|
||||
|
||||
ASSERTIFY(test_assert_quat_eq(result, expected))
|
||||
}
|
||||
}
|
||||
@@ -378,6 +396,9 @@ TEST_IMPL(GLM_PREFIX, euler_yzx_quat) {
|
||||
/*use my function to get the quaternion*/
|
||||
glm_euler_yzx_quat(result, angles);
|
||||
|
||||
/*verify if the magnitude of the quaternion stays 1*/
|
||||
ASSERT(test_eq(glm_quat_norm(result), 1.0f))
|
||||
|
||||
ASSERTIFY(test_assert_quat_eq(result, expected))
|
||||
}
|
||||
|
||||
@@ -413,6 +434,9 @@ TEST_IMPL(GLM_PREFIX, euler_yzx_quat) {
|
||||
/*use my function to get the quaternion*/
|
||||
glm_euler_yzx_quat(result, angles);
|
||||
|
||||
/*verify if the magnitude of the quaternion stays 1*/
|
||||
ASSERT(test_eq(glm_quat_norm(result), 1.0f))
|
||||
|
||||
ASSERTIFY(test_assert_quat_eq(result, expected))
|
||||
}
|
||||
}
|
||||
@@ -453,6 +477,9 @@ TEST_IMPL(GLM_PREFIX, euler_zxy_quat) {
|
||||
/*use my function to get the quaternion*/
|
||||
glm_euler_zxy_quat(result, angles);
|
||||
|
||||
/*verify if the magnitude of the quaternion stays 1*/
|
||||
ASSERT(test_eq(glm_quat_norm(result), 1.0f))
|
||||
|
||||
ASSERTIFY(test_assert_quat_eq(result, expected))
|
||||
}
|
||||
|
||||
@@ -488,6 +515,9 @@ TEST_IMPL(GLM_PREFIX, euler_zxy_quat) {
|
||||
/*use my function to get the quaternion*/
|
||||
glm_euler_zxy_quat(result, angles);
|
||||
|
||||
/*verify if the magnitude of the quaternion stays 1*/
|
||||
ASSERT(test_eq(glm_quat_norm(result), 1.0f))
|
||||
|
||||
ASSERTIFY(test_assert_quat_eq(result, expected))
|
||||
}
|
||||
}
|
||||
@@ -528,6 +558,9 @@ TEST_IMPL(GLM_PREFIX, euler_zyx_quat) {
|
||||
/*use my function to get the quaternion*/
|
||||
glm_euler_zyx_quat(result, angles);
|
||||
|
||||
/*verify if the magnitude of the quaternion stays 1*/
|
||||
ASSERT(test_eq(glm_quat_norm(result), 1.0f))
|
||||
|
||||
ASSERTIFY(test_assert_quat_eq(result, expected))
|
||||
}
|
||||
|
||||
@@ -564,6 +597,9 @@ TEST_IMPL(GLM_PREFIX, euler_zyx_quat) {
|
||||
/*use my function to get the quaternion*/
|
||||
glm_euler_zyx_quat(result, angles);
|
||||
|
||||
/*verify if the magnitude of the quaternion stays 1*/
|
||||
ASSERT(test_eq(glm_quat_norm(result), 1.0f))
|
||||
|
||||
ASSERTIFY(test_assert_quat_eq(result, expected))
|
||||
}
|
||||
}
|
||||
@@ -572,7 +608,6 @@ TEST_IMPL(GLM_PREFIX, euler_zyx_quat) {
|
||||
TEST_SUCCESS
|
||||
}
|
||||
|
||||
|
||||
TEST_IMPL(GLM_PREFIX, quat) {
|
||||
versor q1 = {1.0f, 2.0f, 3.0f, 4.0f};
|
||||
vec3 v1, v2;
|
||||
|
||||
Reference in New Issue
Block a user