mirror of
https://github.com/recp/cglm.git
synced 2026-11-17 18:17:13 -06: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 <[email protected]>
This commit is contained in:
1 parent
6d39ef0026
commit
bfe5ea6ab7
7 files changed
+66
No files matched your search
@@ -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