summaryrefslogtreecommitdiff
path: root/src/ix2.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2018-09-13 16:03:19 -0700
committerVito Caputo <vcaputo@pengaru.com>2018-09-13 16:29:40 -0700
commit2d30a3aa692213a117637e78b82304ecd39a90a9 (patch)
tree78f041cf8f8bc85f3ab150c90821f4f7740a2a40 /src/ix2.h
parentd00a10798e6453f44697103d1f0323446ca4c155 (diff)
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.
Diffstat (limited to 'src/ix2.h')
-rw-r--r--src/ix2.h13
1 files changed, 7 insertions, 6 deletions
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
© All Rights Reserved