diff options
-rw-r--r-- | src/ix3.c | 18 |
1 files changed, 7 insertions, 11 deletions
@@ -182,12 +182,12 @@ static void init_octrants(bb3f_t *octrants, bb3f_t *parent_aabb, v3f_t *octrants /* +-+-+\ - |0|1|-+-+ - +-+-+4|5| - |2|3|-+-+ - +-+-+6|7| - \-+-+ -*/ + |0|1|-+-+ + +-+-+4|5| + |2|3|-+-+ + +-+-+6|7| + \-+-+ +*/ octrants[0].min.x = parent_aabb->min.x; octrants[0].min.y = octrants_center->y; octrants[0].min.z = octrants_center->z; @@ -435,12 +435,10 @@ static ix3_object_t * add_object(ix3_t *ix3, unsigned *depth, ix3_node_t *node, return object; } - /* Node is a leaf, optimistically link the object to the node */ if (!link_object(object, node, reference_cache)) goto _fail; - /* If the node is overflowing, split it */ if (node->n_objects > ix3->max_per_node && *depth < ix3->max_depth) { *depth++; @@ -641,7 +639,6 @@ unsigned ix3_search_by_point(ix3_t *ix3, v3f_t *point, ix3_search_cb cb, void *c n_hits++; } - return n_hits; } @@ -671,12 +668,11 @@ static void search_node_by_aabb(ix3_node_t *node, bb3f_t *node_aabb, v3f_t *sear return; } - list_for_each_entry_safe(ref, _ref, &node->objects, objects) { if (!aabb_overlap(&ref->object->position, &ref->object->origin, &ref->object->aabb, search_position, search_origin, search_aabb)) continue; - list_move_tail(&ref->object->hits, hits); + list_move_tail(&ref->object->hits, hits); } } |