summaryrefslogtreecommitdiffstats
path: root/libdimension/tests
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2012-12-17 15:53:56 -0500
committerTavian Barnes <tavianator@tavianator.com>2012-12-17 16:34:51 -0500
commit9defe68bb518bb7e4c7d6b9954a6f604191b7abd (patch)
tree401d40c16652635e924b7d9dcf0a8c81ceeda82a /libdimension/tests
parent77d871406b15d101cae330947d72a4484eebc698 (diff)
downloaddimension-9defe68bb518bb7e4c7d6b9954a6f604191b7abd.tar.xz
Allow other BVH implementations to be used.
dmnsn_bvh is now a generic API, which could potentially support octrees, etc, in addition to PR-trees.
Diffstat (limited to 'libdimension/tests')
-rw-r--r--libdimension/tests/prtree.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libdimension/tests/prtree.c b/libdimension/tests/prtree.c
index d89a18d..7e69acd 100644
--- a/libdimension/tests/prtree.c
+++ b/libdimension/tests/prtree.c
@@ -1,5 +1,5 @@
/*************************************************************************
- * Copyright (C) 2010-2011 Tavian Barnes <tavianator@tavianator.com> *
+ * Copyright (C) 2010-2012 Tavian Barnes <tavianator@tavianator.com> *
* *
* This file is part of The Dimension Test Suite. *
* *
@@ -21,6 +21,7 @@
* Basic tests of PR-trees
*/
+#include "../bvh.c"
#include "../prtree.c"
#include "../threads.c"
#include "../future.c"
@@ -73,7 +74,7 @@ main(void)
dmnsn_array_push(objects, &object);
}
- dmnsn_prtree *prtree = dmnsn_new_prtree(objects);
+ dmnsn_bvh *bvh = dmnsn_new_bvh(objects, DMNSN_BVH_PRTREE);
dmnsn_intersection intersection;
dmnsn_line ray = dmnsn_new_line(
@@ -81,7 +82,7 @@ main(void)
dmnsn_new_vector(0.0, 0.0, 1.0)
);
- if (!dmnsn_prtree_intersection(prtree, ray, &intersection, true)) {
+ if (!dmnsn_bvh_intersection(bvh, ray, &intersection, true)) {
fprintf(stderr, "--- Didn't find intersection! ---\n");
return EXIT_FAILURE;
}
@@ -93,7 +94,7 @@ main(void)
return EXIT_FAILURE;
}
- dmnsn_delete_prtree(prtree);
+ dmnsn_delete_bvh(bvh);
DMNSN_ARRAY_FOREACH (dmnsn_object **, object, objects) {
dmnsn_delete_object(*object);
}