diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-11-04 23:52:39 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-11-04 23:52:39 -0700 |
commit | 4674a25f40840bba569832423773e9dd5b130ce6 (patch) | |
tree | 3c1dfd4eafdcb5acac78cf721cdab3bbfde2df64 | |
parent | 3cf38d5f3cacc8db44b4d104d0374100cfa57c32 (diff) |
libix3: fix depth maintenance precedence
*depth-- should be (*depth)-- etc.
Basically repeating the same fix I just made in libix2 as the
share a common ancestry
-rw-r--r-- | src/ix3.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -426,7 +426,7 @@ static ix3_object_t * add_object(ix3_t *ix3, unsigned *depth, ix3_node_t *node, bb3f_t octrants[8]; int i; - *depth++; + (*depth)++; init_octrants(octrants, node_aabb, &node->center); for (i = 0; i < 8; i++) { if (!aabb_overlap(NULL, NULL, &octrants[i], &object->position, &object->origin, &object->aabb)) @@ -435,7 +435,7 @@ static ix3_object_t * add_object(ix3_t *ix3, unsigned *depth, ix3_node_t *node, if (!add_object(ix3, depth, &node->children[i], &octrants[i], object, reference_cache)) goto _fail; } - *depth--; + (*depth)--; return object; } @@ -446,10 +446,10 @@ static ix3_object_t * add_object(ix3_t *ix3, unsigned *depth, ix3_node_t *node, /* If the node is overflowing, split it */ if (node->n_objects > ix3->max_per_node && *depth < ix3->max_depth) { - *depth++; + (*depth)++; if (!split_node(ix3, depth, node, node_aabb)) goto _fail; - *depth--; + (*depth)--; } return object; |