Cleanup: use index syntax instead of addition
Harmless but made accessing the first element read strangely.
This commit is contained in:
parent
ce31a892db
commit
bca6978347
@ -796,7 +796,7 @@ static void non_recursive_bvh_div_nodes_task_cb(void *userdata, const int j)
|
||||
|
||||
int k;
|
||||
const int parent_level_index = j - data->i;
|
||||
BVHNode *parent = data->branches_array + j;
|
||||
BVHNode *parent = &data->branches_array[j];
|
||||
int nth_positions[MAX_TREETYPE + 1];
|
||||
char split_axis;
|
||||
|
||||
@ -835,7 +835,7 @@ static void non_recursive_bvh_div_nodes_task_cb(void *userdata, const int j)
|
||||
const int child_leafs_end = implicit_leafs_index(data->data, data->depth + 1, child_level_index + 1);
|
||||
|
||||
if (child_leafs_end - child_leafs_begin > 1) {
|
||||
parent->children[k] = data->branches_array + child_index;
|
||||
parent->children[k] = &data->branches_array[child_index];
|
||||
parent->children[k]->parent = parent;
|
||||
}
|
||||
else if (child_leafs_end - child_leafs_begin == 1) {
|
||||
@ -879,13 +879,13 @@ static void non_recursive_bvh_div_nodes(
|
||||
int depth;
|
||||
|
||||
/* set parent from root node to NULL */
|
||||
BVHNode *tmp = branches_array + 0;
|
||||
BVHNode *tmp = &branches_array[0];
|
||||
tmp->parent = NULL;
|
||||
|
||||
/* Most of bvhtree code relies on 1-leaf trees having at least one branch
|
||||
* We handle that special case here */
|
||||
if (num_leafs == 1) {
|
||||
BVHNode *root = branches_array + 0;
|
||||
BVHNode *root = &branches_array[0];
|
||||
refit_kdop_hull(tree, root, 0, num_leafs);
|
||||
root->main_axis = get_largest_axis(root->bv) / 2;
|
||||
root->totnode = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user