quat: add new function glm_quat_make

Function takes in a 4 element float array
and converts it into a quaternion.

Signed-off-by: Vincent Davis Jr <vince@underview.tech>
This commit is contained in:
Vincent Davis Jr
2023-06-28 22:49:49 -05:00
parent 6d39ef0026
commit bfe5ea6ab7
7 changed files with 66 additions and 0 deletions

View File

@@ -1084,3 +1084,15 @@ TEST_IMPL(GLM_PREFIX, quat_rotate_atm) {
TEST_SUCCESS
}
TEST_IMPL(GLM_PREFIX, quat_make) {
versor dest;
float src[4] = {7.2f, 1.0f, 2.5f, 6.1f};
GLM(quat_make)(src, dest);
for (unsigned int i = 0; i < sizeof(src) / sizeof(float); i++) {
ASSERT(test_eq(src[i], dest[i]));
}
TEST_SUCCESS
}