From 9defe68bb518bb7e4c7d6b9954a6f604191b7abd Mon Sep 17 00:00:00 2001
From: Tavian Barnes <tavianator@tavianator.com>
Date: Mon, 17 Dec 2012 15:53:56 -0500
Subject: 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.
---
 libdimension/tests/prtree.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'libdimension/tests')

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);
   }
-- 
cgit v1.2.3