collision-rs icon indicating copy to clipboard operation
collision-rs copied to clipboard

Concave mesh collisions

Open LaylBongers opened this issue 7 years ago • 3 comments

This is a fairly common need for a lot of games. I know it's hard to implement well but I feel it's important to have this option for meshes like terrain.

LaylBongers avatar Aug 24 '18 00:08 LaylBongers

I would say that terrain being represented with a mesh for collision purposes is rare, it would usually be a heightmap coupled with other shapes for overhangs etc.

But as @kvark noted above, we appreciate help, so feel free to implement something and give us a PR.

Rhuagh avatar Aug 25 '18 19:08 Rhuagh

Looking further through how Bullet implements this, it seems to use concave collision detection for this use case, even for heightmaps (though those get some optimization). However the actual implementation goes way over my head, I can't even find where it's located let alone port it.

LaylBongers avatar Sep 03 '18 01:09 LaylBongers

I did some further digging, and it seems the ReactPhysics3D library takes the same approach as Bullet (including how it implements concave meshes), but its codebase is much more understandable to take as reference. https://github.com/DanielChappuis/reactphysics3d

However, I still can't quite understand how the implementation works myself.

LaylBongers avatar Sep 03 '18 01:09 LaylBongers