mirror of
https://github.com/recp/cglm.git
synced 2025-12-25 12:55:04 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user