Age | Commit message (Collapse) | Author |
|
*depth-- should be (*depth)-- etc.
surprisingly this went unnoticed for some time but I haven't
really been using libix[23] in anything other than sars which
didn't get much play/testing etc. But a quick ASAN run
immediately uncovered this one.
|
|
See 6ea78c53 in libix3 for more info, this replicates the change to
keep them in something resembling API parity.
|
|
I despise hiding pointer types in typedefs, it makes usage
less clear/obvious to the reader.
|
|
oops
|
|
Previously one could say stop/ignore/continue.
There was no way to say stop and ignore, or stop but don't ignore.
Now there are basically two classes of returns, stop and continue,
and each of those have ignore/don't ignore sub-statuses. The naming
is changed to STOP vs. MORE and HIT vs. MISS for brevity:
typedef enum ix2_search_status_t {
IX2_SEARCH_STOP_MISS,
IX2_SEARCH_STOP_HIT,
IX2_SEARCH_MORE_MISS,
IX2_SEARCH_MORE_HIT
} ix2_search_status_t;
|
|
The code used calloc() previously, and there remain assumptions
about the allocated memory being zeroed, hence adding the flag
to libpad and using it here.
|
|
This basically amounts to adding a pad_reset() wrapper.
Also incorporated resets into the test, while fixing a stupid
bug there.
|
|
Note that libpad doesn't currently have the fixed size variant,
so the pad_get() calls must include the size temporarily.
Regardless, I've still utilized three distinct pads for the three
object types in preparation for the fixed size variant.
|
|
mechanical change syncing the test code with the aabb type rename
|
|
|
|
This is a private helper function.
|
|
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.
|
|
also use v2f_t everywhere for positions instead of
the occasional float x, float y.
|
|
|
|
ix2_insert_object
ix2_remove_object
ix2_move_object
becomes
ix2_object_new
ix2_object_free
ix2_object_move
to be more consistent with the other libraries intended to be used
with this.
|
|
I may need to add another status code to control wether the stop
should be counted. For now, all my use cases wanted the count.
|
|
Much like libstage nodes can now have their position set using relative
AABBs, it's convenient to have the same paradigm in libix2.
|
|
Was returning the user-supplied object pointer as the ix2_object_t,
oops.
|
|
The -1,-1...1,1 AABB seems so likely to be used, make it the
default used when supplying a NULL for the root AABB.
|
|
libix2 implements a simple spatial index of objects described by
2D axis-aligned bounding boxes (AABB).
It does so by internally utilizing a traditional quadtree data
structure.
At this time only simple AABB and point search queries are
supported, with a simple per-match callback interface.
It may make sense to in the future add support for indexing
other 2D shapes than AABBs, like circles.
It would also make senes to add more interesting search queries
like radial ranges and such.
The intended use is for broad-phase collision detection in
2D games.
|