From 9defe68bb518bb7e4c7d6b9954a6f604191b7abd Mon Sep 17 00:00:00 2001 From: Tavian Barnes 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/prtree.h | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'libdimension/prtree.h') diff --git a/libdimension/prtree.h b/libdimension/prtree.h index 733f854..0a8224a 100644 --- a/libdimension/prtree.h +++ b/libdimension/prtree.h @@ -1,5 +1,5 @@ /************************************************************************* - * Copyright (C) 2010-2011 Tavian Barnes * + * Copyright (C) 2010-2012 Tavian Barnes * * * * This file is part of The Dimension Library. * * * @@ -26,27 +26,5 @@ * from B-trees. */ -#include - -/** A priority R-tree; the spatial subdivision method used for intersection - queries against the scene graph. */ -typedef struct dmnsn_prtree { - dmnsn_bounding_box bounding_box; /**< The bounding box for the whole scene. */ - dmnsn_array *unbounded; /**< The unbounded objects. */ - dmnsn_array *bounded; /**< A PR-tree of the bounded objects. */ - size_t id; /**< A unique ID for the PR-tree. */ -} dmnsn_prtree; - /** Create a PR-tree. */ -DMNSN_INTERNAL dmnsn_prtree *dmnsn_new_prtree(const dmnsn_array *objects); -/** Delete a PR-tree. */ -DMNSN_INTERNAL void dmnsn_delete_prtree(dmnsn_prtree *tree); - -/** Find the closest ray-object intersection in the tree. */ -DMNSN_INTERNAL bool dmnsn_prtree_intersection(const dmnsn_prtree *tree, - dmnsn_line ray, - dmnsn_intersection *intersection, - bool reset); -/** Determine whether a point is inside any object in the tree. */ -DMNSN_INTERNAL bool dmnsn_prtree_inside(const dmnsn_prtree *tree, - dmnsn_vector point); +DMNSN_INTERNAL dmnsn_bvh_node *dmnsn_new_prtree(const dmnsn_array *objects); -- cgit v1.2.3