- separating struct types into types-struct.h

- vec3s implementation
- fix style issues
This commit is contained in:
acoto87
2019-04-08 21:06:01 -05:00
parent 1de8aeb940
commit 1aa54dc110
10 changed files with 617 additions and 117 deletions

View File

@@ -47,6 +47,14 @@ test_rand_vec3(vec3 dest) {
dest[2] = drand48();
}
vec3s
test_rand_vec3s()
{
vec3s r;
test_rand_vec3(r.raw);
return r;
}
void
test_rand_vec4(vec4 dest) {
srand((unsigned int)time(NULL));
@@ -127,6 +135,12 @@ test_assert_vec3_eq(vec3 v1, vec3 v2) {
assert_true(fabsf(v1[2] - v2[2]) <= 0.000009);
}
void
test_assert_vec3s_eq(vec3s v1, vec3s v2)
{
test_assert_vec3_eq(v1.raw, v2.raw);
}
void
test_assert_vec4_eq(vec4 v1, vec4 v2) {
assert_true(fabsf(v1[0] - v2[0]) <= 0.000009); /* rounding errors */