Closed bjornbytes closed 6 months ago
Oops, the ToJolt
methods for the filters are returning references to stack memory, I'll need to rethink those.
Ok this should be good to go, I'm using the new raycast/shapecast callbacks in LÖVR successfully now. If you have a better idea for those _padding
members, go for it, it was just to silence a warning about padding >_<.
Thanks!
This exposes
BroadPhaseQuery
and more of theNarrowPhaseQuery
methods.I didn't like the existing collector objects because they required excessive heap allocation and didn't allow the application to control early exit behavior. I converted them to C callback functions, and internally the bindings create a C++ collector class that calls the C callback for every hit. This gives the application more control over how it handles the hits -- it could append to a list, track the closest hit, do custom filtering, immediately cancel the raycast on the first hit, etc.