dimforge / nphysics

2 and 3-dimensional rigid body physics engine for Rust.
https://nphysics.org
Apache License 2.0
1.63k stars 121 forks source link

Custom Broadphase Collision Filters #251

Closed rhololkeolke closed 4 years ago

rhololkeolke commented 4 years ago

The ability to add custom collision filters, like we can in ncollide, is currently missing. I would like to use this to filter collisions between parent and child links in a multibody. I could potentially do a limited version of this using lots of collision groups, but the filter seems like the better approach.

The docs refer to the ncollide event handling in the interactions and sensor section . However, looking at the ncollide docs and API it appears this functionality is only available on a CollisionWorld object which isn't used in nphysics.

I see that there is a commented out section to store these types of filters in the geometrical world code. https://github.com/rustsim/nphysics/blob/70aa53c70cef4b71b81b5811269a1d93b1744923/src/world/geometrical_world.rs#L35-L38

What is the blocker on exposing this feature in nphysics? Depending on the complexity, I may be able to take a stab at exposing this feature.

neachdainn commented 4 years ago

I am also very interested in being able to do this.

sebcrozet commented 4 years ago

This is fixed and published with the version 0.15.1. I also added an example which prevents contacts between two links of a multibody.