Merge branch 'master' into cglm-structs

This commit is contained in:
Alejandro Coto Gutiérrez
2019-04-30 14:58:02 -05:00
committed by GitHub
7 changed files with 26 additions and 19 deletions

View File

@@ -51,8 +51,8 @@ test_bezier(void **state) {
Bs_plain = test_bezier_plain(s, p0, c0, c1, p1);
assert_true(glm_eq(Bs, Bs_plain));
assert_true(glm_eq(smc, Bs_plain));
assert_true(glm_eq(Bs, smc));
test_assert_eqf(smc, Bs_plain);
test_assert_eqf(Bs, smc);
/* test cubic hermite */
smc = glm_smc(s, GLM_HERMITE_MAT, (vec4){p0, p1, c0, c1});

View File

@@ -5,6 +5,7 @@
#include "test_common.h"
#include <stdlib.h>
#include <math.h>
#define m 4
#define n 4

View File

@@ -93,6 +93,13 @@ test_vec4(void **state) {
/* 3. test SIMD norm2 */
test_rand_vec4(v);
test_assert_eqf(test_vec4_norm2(v), glm_vec4_norm2(v));
/* 4. test SSE/SIMD distance */
test_rand_vec4(v1);
test_rand_vec4(v2);
d1 = glm_vec4_distance(v1, v2);
d2 = sqrtf(powf(v1[0]-v2[0], 2.0f) + pow(v1[1]-v2[1], 2.0f) + pow(v1[2]-v2[2], 2.0f) + pow(v1[3]-v2[3], 2.0f));
assert_true(fabsf(d1 - d2) <= 0.000009);
}
/* test zero */