summaryrefslogtreecommitdiffstats
path: root/libdimension/tests
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension/tests')
-rw-r--r--libdimension/tests/bvh/prtree.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/libdimension/tests/bvh/prtree.c b/libdimension/tests/bvh/prtree.c
index fb0cea6..31f1490 100644
--- a/libdimension/tests/bvh/prtree.c
+++ b/libdimension/tests/bvh/prtree.c
@@ -30,13 +30,13 @@
#include <stdio.h>
#include <stdlib.h>
-unsigned int calls = 0;
+static unsigned int calls = 0;
static bool
dmnsn_fake_intersection_fn(const dmnsn_object *object, dmnsn_ray ray,
dmnsn_intersection *intersection)
{
- intersection->t = (object->aabb.min.z - ray.x0.z)/ray.n.z;
+ intersection->t = (object->aabb.min.Z - ray.x0.Z)/ray.n.Z;
intersection->normal = dmnsn_x;
++calls;
return true;
@@ -47,13 +47,10 @@ dmnsn_randomize_aabb(dmnsn_object *object)
{
dmnsn_vector a, b;
- a.x = 2.0*((double)rand())/RAND_MAX - 1.0;
- a.y = 2.0*((double)rand())/RAND_MAX - 1.0;
- a.z = 2.0*((double)rand())/RAND_MAX - 1.0;
-
- b.x = 2.0*((double)rand())/RAND_MAX - 1.0;
- b.y = 2.0*((double)rand())/RAND_MAX - 1.0;
- b.z = 2.0*((double)rand())/RAND_MAX - 1.0;
+ for (unsigned int i = 0; i < 3; ++i) {
+ a.n[i] = 2.0*((double)rand())/RAND_MAX - 1.0;
+ b.n[i] = 2.0*((double)rand())/RAND_MAX - 1.0;
+ }
object->aabb.min = dmnsn_vector_min(a, b);
object->aabb.max = dmnsn_vector_max(a, b);