Sphere Box collisions
Posted: Mon Sep 26, 2011 4:39 pm
The Sphere Box collision algorithm has been disabled in Bullet for several releases. I found some old posts in the forum saying that there was a bug in the code and since Sphere Box could use GJK instead there was no plan to fix it.
However if your application has a lot of basic collision primitives, using GJK for sphere box is needlessly expensive and can lead to contact inaccuracies (specifically it tends to introduce parasite rotations).
After digging into it a bit it turns out the current collision algorithm indeed had some logic issues with the way the margin was used.
I would like to propose the following code (see attached file) as a replacement for the sphere box collision algorithm. This new algorithm also takes the separation distance into account for generating contacts to improve rolling contact situations. It is quite easy to remove that extra distance if you want an exact contact trigger.
Any feedback would be appreciated.
However if your application has a lot of basic collision primitives, using GJK for sphere box is needlessly expensive and can lead to contact inaccuracies (specifically it tends to introduce parasite rotations).
After digging into it a bit it turns out the current collision algorithm indeed had some logic issues with the way the margin was used.
I would like to propose the following code (see attached file) as a replacement for the sphere box collision algorithm. This new algorithm also takes the separation distance into account for generating contacts to improve rolling contact situations. It is quite easy to remove that extra distance if you want an exact contact trigger.
Any feedback would be appreciated.