Obtaining maximum possible collision detection accuracy

pwiecz
Posts: 8
Joined: Mon Aug 15, 2016 7:11 pm

Obtaining maximum possible collision detection accuracy

Post by pwiecz »

Hi,
I'm a very novice bullet physics user, and have stumbled upon a seemingly straightforward problem, but couldn't find an answer searching the forum (maybe I wasn't searching thoroughly enough).

I'd like to detect collision between two arbitrary concave meshes with highest possible accuracy (let's assume I'm not caring much about performance).
I've created two particular btGImpactMeshShape's and called setMargin(0) on them.
I've added both of them to a btCollisionWorld.

I was using btIDebugDraw to check their actual position, and was calling contactPairTest to detect their collision (I assume any call to ContactResultCallback means collision).

And I saw collision being reported even though both shapes were separated by a couple of coordinate units.

Are there any more knobs I can turn to achieve better accuracy?

Thanks in advance,
Piotr
benelot
Posts: 350
Joined: Sat Jul 04, 2015 10:33 am
Location: Bern, Switzerland

Re: Obtaining maximum possible collision detection accuracy

Post by benelot »

Bullet Physics to my knowledge is not meant to be perfectly accurate but rather to be of good performance for games and real time simulations. Setting themargin to 0 is even slightly counterintuitive in that it causes some collisions not to be detected and some at a smaller gap in distance. Better try a very small margin than directly zero. Something like 0.01 might be well for your purpose. What are you using such a high precision for?

Here is some previous discussion on the topic:
http://www.bulletphysics.org/Bullet/php ... =9&t=11165