- C 94%
- Makefile 6%
| lib/jn | ||
| cache.c | ||
| cache.h | ||
| index.c | ||
| index.h | ||
| jntypes.h | ||
| main.c | ||
| main.h | ||
| Makefile | ||
| object.c | ||
| object.h | ||
| presence.c | ||
| presence.h | ||
| README.md | ||
| scene.h | ||
| template.mk | ||
| vector.c | ||
| vector.h | ||
| wisedom.h | ||
we are looking for constant access time of objects by their position, so we transpose each position vector and build a cache matrix from those, indexed parallel to the source instance array.
then we build an index record of object pointers for each position axis, offsetting each entry by the corresponding position component (optionally divided by some conversion factor if one to one unit accuracy is too expensive).
in order to find an object matching in position, we call Object.coincidesWith for each component, and ensure our two objects' positions coincide on all axes.
the final step is to compute the collision of our source object (e.g. a ray) with our collider found from the index record, according to the shape of each.
for this reason, the position which we cache and index with should be the offset applied to the algebraic equation matching each shape involved.