From 2d30a3aa692213a117637e78b82304ecd39a90a9 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Thu, 13 Sep 2018 16:03:19 -0700 Subject: libix2: s/aabb_t/bb2f_t/g aabb_t is a dimensionless name, and I've started mixing 2D and 3D paradigms in the same projects so it's time to include the number of dimensions for the bounding box. bb2f_t is also more consistent with the vector and matrix header naming schemes I've been using. --- src/ix2.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/ix2.h') diff --git a/src/ix2.h b/src/ix2.h index 5f3b5cb..0f6f69f 100644 --- a/src/ix2.h +++ b/src/ix2.h @@ -19,7 +19,7 @@ typedef struct ix2_object_t ix2_object_t; typedef struct ix2_t ix2_t; -typedef struct aabb_t aabb_t; +typedef struct bb2f_t bb2f_t; typedef struct v2f_t v2f_t; typedef enum ix2_search_status_t { @@ -28,15 +28,16 @@ typedef enum ix2_search_status_t { IX2_SEARCH_CONTINUE } ix2_search_status_t; -typedef ix2_search_status_t (*ix2_search_cb)(void *cb_context, ix2_object_t *ix2_object, v2f_t *ix2_object_position, aabb_t *ix2_object_aabb, void *object); +typedef ix2_search_status_t (*ix2_search_cb)(void *cb_context, ix2_object_t *ix2_object, v2f_t *ix2_object_position, bb2f_t *ix2_object_aabb, void *object); -ix2_t * ix2_new(aabb_t *aabb, unsigned max_per_node, unsigned max_depth); +ix2_t * ix2_new(bb2f_t *aabb, unsigned max_per_node, unsigned max_depth); void ix2_free(ix2_t *ix2); -ix2_object_t * ix2_object_new(ix2_t *ix2, v2f_t *position, v2f_t *origin, aabb_t *aabb, void *object); +ix2_object_t * ix2_object_new(ix2_t *ix2, v2f_t *position, v2f_t *origin, bb2f_t *aabb, void *object); void ix2_object_free(ix2_t *ix2, ix2_object_t *object); -ix2_object_t * ix2_object_move(ix2_t *ix2, ix2_object_t *object, v2f_t *object_position, v2f_t *object_origin, aabb_t *object_aabb); +ix2_object_t * ix2_object_move(ix2_t *ix2, ix2_object_t *object, v2f_t *object_position, v2f_t *object_origin, bb2f_t *object_aabb); +int ix2_object_aabb_overlap(ix2_t *ix2, ix2_object_t *object, v2f_t *aabb_position, v2f_t *aabb_origin, bb2f_t *aabb); unsigned ix2_search_by_point(ix2_t *ix2, v2f_t *point, ix2_search_cb cb, void *arg); -unsigned ix2_search_by_aabb(ix2_t *ix2, v2f_t *search_position, v2f_t *search_origin, aabb_t *search_aabb, ix2_search_cb cb, void *arg); +unsigned ix2_search_by_aabb(ix2_t *ix2, v2f_t *search_position, v2f_t *search_origin, bb2f_t *search_aabb, ix2_search_cb cb, void *arg); unsigned ix2_search_by_ray(ix2_t *ix2, v2f_t *origin, v2f_t *direction, ix2_search_cb cb, void *arg); #endif -- cgit v1.2.3