mirror of
https://github.com/recp/cglm.git
synced 2025-12-26 02:25:02 +00:00
new wrappers for lookat
This commit is contained in:
@@ -7,6 +7,22 @@
|
||||
|
||||
#include "test_common.h"
|
||||
|
||||
void
|
||||
test_camera_lookat(void **state) {
|
||||
mat4 view1, view2;
|
||||
vec3 eye = {0.024f, 14.6f, 67.04f},
|
||||
dir = {0.0f, 0.0f, -1.0f},
|
||||
up = GLM_YUP,
|
||||
center;
|
||||
|
||||
glm_vec_add(eye, dir, center);
|
||||
glm_lookat(eye, center, up, view1);
|
||||
|
||||
glm_look(eye, dir, up, view2);
|
||||
|
||||
test_assert_mat4_eq(view1, view2);
|
||||
}
|
||||
|
||||
void
|
||||
test_camera_decomp(void **state) {
|
||||
mat4 proj, proj2;
|
||||
@@ -35,4 +51,3 @@ test_camera_decomp(void **state) {
|
||||
|
||||
test_assert_mat4_eq(proj, proj2);
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,9 @@ main(int argc, const char * argv[]) {
|
||||
cmocka_unit_test(test_mat4),
|
||||
|
||||
/* camera */
|
||||
cmocka_unit_test(test_camera_lookat),
|
||||
cmocka_unit_test(test_camera_decomp)
|
||||
};
|
||||
|
||||
return cmocka_run_group_tests(tests,
|
||||
NULL,
|
||||
NULL);
|
||||
return cmocka_run_group_tests(tests, NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
void test_mat4(void **state);
|
||||
|
||||
/* camera */
|
||||
void
|
||||
test_camera_lookat(void **state);
|
||||
|
||||
void
|
||||
test_camera_decomp(void **state);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user