diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2012-12-17 15:53:56 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2012-12-17 16:34:51 -0500 |
commit | 9defe68bb518bb7e4c7d6b9954a6f604191b7abd (patch) | |
tree | 401d40c16652635e924b7d9dcf0a8c81ceeda82a /libdimension/prtree.h | |
parent | 77d871406b15d101cae330947d72a4484eebc698 (diff) | |
download | dimension-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/prtree.h')
-rw-r--r-- | libdimension/prtree.h | 26 |
1 files changed, 2 insertions, 24 deletions
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 <tavianator@tavianator.com> * + * Copyright (C) 2010-2012 Tavian Barnes <tavianator@tavianator.com> * * * * This file is part of The Dimension Library. * * * @@ -26,27 +26,5 @@ * from B-trees. */ -#include <stdbool.h> - -/** 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); |