diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2018-05-18 12:41:08 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2018-05-18 12:41:08 -0700 |
commit | 1824156efa21590a7f362ff8c786f03f5ba0f51c (patch) | |
tree | bdd5c9a894ac914e61f208c9db6b2337f3df4cd1 /src/ix2.h | |
parent | 6bb650c8062b76770624073f779dcf433028fddd (diff) |
libix2: introduce AABB-independent object position
Much like libstage nodes can now have their position set using relative
AABBs, it's convenient to have the same paradigm in libix2.
Diffstat (limited to 'src/ix2.h')
-rw-r--r-- | src/ix2.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -28,15 +28,15 @@ 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, 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, aabb_t *ix2_object_aabb, void *object); ix2_t * ix2_new(aabb_t *aabb, unsigned max_per_node, unsigned max_depth); void ix2_free(ix2_t *ix2); -ix2_object_t * ix2_insert_object(ix2_t *ix2, aabb_t *aabb, void *object); +ix2_object_t * ix2_insert_object(ix2_t *ix2, float x, float y, aabb_t *aabb, void *object); void ix2_remove_object(ix2_t *ix2, ix2_object_t *object); -ix2_object_t * ix2_move_object(ix2_t *ix2, ix2_object_t *object, aabb_t *aabb); +ix2_object_t * ix2_move_object(ix2_t *ix2, ix2_object_t *object, float object_x, float object_y, aabb_t *object_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, aabb_t *aabb, ix2_search_cb cb, void *arg); +unsigned ix2_search_by_aabb(ix2_t *ix2, float x, float y, aabb_t *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 |