This is a small test app, reproducing my troubles with Bullet.

Keys:

- arrow keys to move the camera
- hold the left mouse button and drag the mouse to rotate the camera
- "4" and "6" move the convex along the X axis
- "8" and "2" move the convex along the Y axis
- "r" to enable the reference implementation

When the convexes are separated, a green vector is drawn between the two closest points.

When the convexes are penetrating, an orange wireframe convex is drawn where the object should be (using the reported penetration depth and penetration vector).

The app shows a case that fails. The convexes are overlapping, yet Bullet reports a separation (and a green vector gets drawn between bogus points).

For comparison, a reference implementation is included. It computes the penetration depth using a brute force method. It is very slow, but it always gives the correct results. If you enable it, you will see a blue wireframe convex drawn at a correct position, when penetration happens.

Maybe I missed something, maybe I'm not using the lib correctly. Source code is included, please tell me what is wrong.

This is a bit puzzling because the penetration in that repro case is not "deep" at all. And this problem is *exactly* the one I had in the past with Solid 3.5. Apparently it never got fixed.

If this can't be fixed, Bullet is useless for me. From the penetration vector I select two "best" contact polygons on the convexes, and this completely fails (making the sim explode) if the penetration vector is wrong. As you can imagine, it is not good enough to get correct results 95% of the time, if the sim explodes in the 5% left.

----------

You can use the Space key to change the penetration depth solver. Unfortunately they all have troubles:
- the Solid3 solver has the above issue
- the other EPA solver has the same issue, and also prints a bunch of error messages
- the Minkowski version using precomputed directions just never return an overlap (I guess this one is a simple bug)


Comments? Ideas?

Thanks for any feedback/help. I could really use Bullet, if it gave me reliable results.

- Pierre