dimforge / ncollide

2 and 3-dimensional collision detection library in Rust.
https://ncollide.org
Apache License 2.0
921 stars 107 forks source link

Best way to proximity check groups with filter #375

Open ernstluring opened 3 years ago

ernstluring commented 3 years ago

We have the specific case that we want to collision check groups of objects (cubes, cylinders and meshes) with other groups of objects with the possibility to ignore the collision of specific objects. We want to perform 1000's of queries with dynamic objects at different locations (objects are moving around). We only want proximity's and which objects are colliding, not any contact points etc. We tried the following two things:

  1. Using the CollisionWorld. But the event system was not flexible enough for our use case. We also want to know if a repeated collision happened.

  2. Creating our own Compound implementation of the group of objects and the corresponding proximity and proximity detectors. And passing a filter function with them. This resulted in a problem with testing out Trimeshes. Because Compound shapes in Compound shapes are not supported, the algorithm became very slow.

What would be the best approach to tackle this problem? Is ncollide the right library for us, or would parry solve this problem better?