Initial implementation of struct type vec4s

This commit is contained in:
acoto87
2019-04-03 22:25:49 -06:00
parent 674e05213a
commit c25469829a
8 changed files with 178 additions and 29 deletions

View File

@@ -57,6 +57,14 @@ test_rand_vec4(vec4 dest) {
dest[3] = drand48();
}
vec4s
test_rand_vec4s()
{
vec4s r;
test_rand_vec4(r.raw);
return r;
}
float
test_rand(void) {
srand((unsigned int)time(NULL));
@@ -127,6 +135,12 @@ test_assert_vec4_eq(vec4 v1, vec4 v2) {
assert_true(fabsf(v1[3] - v2[3]) <= 0.000009);
}
void
test_assert_vec4s_eq(vec4s v1, vec4s v2)
{
test_assert_vec4_eq(v1.raw, v2.raw);
}
void
test_assert_quat_eq_abs(versor v1, versor v2) {
assert_true(fabsf(fabsf(v1[0]) - fabsf(v2[0])) <= 0.0009); /* rounding errors */