Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Genrich <daniel.genrich@gmx.net>2008-08-03 15:40:09 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2008-08-03 15:40:09 +0400
commit7a14a3580bdd942bfcf8a299899f03abbc5814f1 (patch)
tree5b4cfd31431a2024b03936e4e39853d7d2ccd164 /source/blender/blenlib
parent1d49ed89cbbb8359a61eb2ced25f942825e129b0 (diff)
Little speedup for kdop-bvh
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/intern/BLI_kdopbvh.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c
index a97b9ca6672..4ceb9762a7b 100644
--- a/source/blender/blenlib/intern/BLI_kdopbvh.c
+++ b/source/blender/blenlib/intern/BLI_kdopbvh.c
@@ -484,15 +484,14 @@ static char get_largest_axis(float *bv)
}
}
-static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, char lastaxis)
+static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end)
{
- char laxis;
int i, tend;
BVHNode *tnode;
int slice = (end-start+tree->tree_type-1)/tree->tree_type; //division rounded up
// Determine which axis to split along
- laxis = get_largest_axis(node->bv);
+ char laxis = get_largest_axis(node->bv);
// split nodes along longest axis
for (i=0; start < end; start += slice, i++) //i counts the current child
@@ -515,7 +514,7 @@ static void bvh_div_nodes(BVHTree *tree, BVHNode *node, int start, int end, char
if(tend != end)
partition_nth_element(tree->nodes, start, end, tend, laxis);
refit_kdop_hull(tree, tnode, start, tend);
- bvh_div_nodes(tree, tnode, start, tend, laxis);
+ bvh_div_nodes(tree, tnode, start, tend);
}
node->totnode++;
}
@@ -586,7 +585,7 @@ void BLI_bvhtree_balance(BVHTree *tree)
// refit root bvh node
refit_kdop_hull(tree, tree->nodes[tree->totleaf], 0, tree->totleaf);
// create + balance tree
- bvh_div_nodes(tree, tree->nodes[tree->totleaf], 0, tree->totleaf, 0);
+ bvh_div_nodes(tree, tree->nodes[tree->totleaf], 0, tree->totleaf);
// verify_tree(tree);
}