diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-05-11 18:39:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-05-11 18:40:50 +0300 |
commit | 725a088ef9fce540069b19e9b1346c3d04056f8b (patch) | |
tree | dac50b9b248eab6f699ac1d5a3023b364308dc58 /source/blender/blenkernel/intern | |
parent | 79d01de6b06223c769f41a898652100cfd4d8b67 (diff) |
Correct check for tree being in BVH cache
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/bvhutils.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 37392601b4b..88be7328492 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -1162,6 +1162,18 @@ BVHTree *bvhcache_find(BVHCache *cache, int type) return NULL; } +bool bvhcache_has_tree(const BVHCache *cache, const BVHTree *tree) +{ + while (cache) { + const BVHCacheItem *item = cache->link; + if (item->tree == tree) { + return true; + } + cache = cache->next; + } + return false; +} + /** * Inserts a BVHTree of the given type under the cache * After that the caller no longer needs to worry when to free the BVHTree |