diff options
Diffstat (limited to 'source/blender/blenlib/intern/BLI_kdopbvh.c')
-rw-r--r-- | source/blender/blenlib/intern/BLI_kdopbvh.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 4d64f4a50ff..01f2ab4436c 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -1,4 +1,4 @@ -/** +/* * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -30,7 +30,9 @@ #include "MEM_guardedalloc.h" -#include "BKE_utildefines.h" +#include "BLI_utildefines.h" + + #include "BLI_kdopbvh.h" #include "BLI_math.h" @@ -159,7 +161,8 @@ static float KDOP_AXES[13][3] = heap[parent] = element; \ } -int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, int *max_size, int size_per_item) +#if 0 +static int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, int *max_size, int size_per_item) { int new_max_size = *max_size * 2; void *new_memblock = NULL; @@ -184,7 +187,7 @@ int ADJUST_MEMORY(void *local_memblock, void **memblock, int new_size, int *max_ else return FALSE; } - +#endif ////////////////////////////////////////////////////////////////////////////////////////////////////// // Introsort @@ -1126,19 +1129,20 @@ static void traverse(BVHOverlapData *data, BVHNode *node1, BVHNode *node2) return; } -BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, int *result) +BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, unsigned int *result) { - int j, total = 0; + int j; + unsigned int total = 0; BVHTreeOverlap *overlap = NULL, *to = NULL; BVHOverlapData **data; // check for compatibility of both trees (can't compare 14-DOP with 18-DOP) if((tree1->axis != tree2->axis) && (tree1->axis == 14 || tree2->axis == 14) && (tree1->axis == 18 || tree2->axis == 18)) - return 0; + return NULL; // fast check root nodes for collision before doing big splitting + traversal if(!tree_overlap(tree1->nodes[tree1->totleaf], tree2->nodes[tree2->totleaf], MIN2(tree1->start_axis, tree2->start_axis), MIN2(tree1->stop_axis, tree2->stop_axis))) - return 0; + return NULL; data = MEM_callocN(sizeof(BVHOverlapData *)* tree1->tree_type, "BVHOverlapData_star"); |