MobileMesh wrapped in compound problem


I have been tracking down a problem with mobilemeshes "sticking" to other meshes and generally a bad behavior. (i am using the latest version 92b2ac9a73a4)

The problem appears when two MobileMesh shaped that are wrapped in a compoundbody, collide with each other.

I was able to reproduce it in a modified MobileMeshDemo.cs (attached).
Start the demo and use mouse drag to throw the inner body around and it will stick on the outer body. It may also start shaking and you probably will not be able to grab it with the mouse anymore.
(You can throw it on the 'roof' and it will stick on it)

file attachments

Closed Jul 27, 2015 at 5:28 PM by RossNordby


RossNordby wrote Jul 24, 2015 at 7:13 PM

This appears to be expected behavior for MobileMeshSolidity.DoubleSided. It's very easy for a triangle of one mesh to be caught behind the triangle of the other mesh, and the generated contacts will fight separation.

Theoretically, a perfect CCD implementation could stop that from happening, but the approximate CCD in BEPUphysics is not strict enough.

The recommended solution is to use one of the one-sided MobileMeshSolidity modes instead. For example, if each mesh's MobileMeshSolidity is set to Counterclockwise (as it was in the original demo), the stickiness goes away.

VirusFree wrote Jul 25, 2015 at 11:22 AM

You are absolutely right! changing the sideness made things a lot better. (i would have never guess that)
Thank you very much!! :)