Physics Simulation Forum

 

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Sphere Box collisions
PostPosted: Mon Sep 26, 2011 4:39 pm 
Offline

Joined: Tue Oct 05, 2010 9:36 pm
Posts: 29
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.


Attachments:
btSphereBoxCollisionAlgorithm.cpp [7.37 KiB]
Downloaded 97 times
Top
 Profile  
 
PostPosted: Tue Sep 27, 2011 4:24 pm 
Offline

Joined: Tue Oct 05, 2010 9:36 pm
Posts: 29
Here is the matching .h to make integration easier. Of course you will also need to remove the USE_BUGGY_SPHERE_BOX_ALGORITHM #define in the rest of the code.


Attachments:
btSphereBoxCollisionAlgorithm.h [3.46 KiB]
Downloaded 63 times
Top
 Profile  
 
PostPosted: Fri Oct 07, 2011 4:50 pm 
Offline

Joined: Tue Oct 05, 2010 9:36 pm
Posts: 29
Hi Erwin,
I never got any feedback on this code but I have been testing it in my engine for a while now with no issues. Would it be OK to submit it to integrate it to the main Bullet code branch?


Top
 Profile  
 
PostPosted: Fri May 25, 2012 1:44 pm 
Offline

Joined: Thu Mar 01, 2012 10:07 pm
Posts: 7
Out of interest, did anything come of this?


Top
 Profile  
 
PostPosted: Mon May 28, 2012 7:02 pm 
Offline

Joined: Sun Sep 30, 2007 7:58 am
Posts: 225
Hi Laurent,

thanks for your work.

I would suggest to post such issues/patches here:
http://code.google.com/p/bullet/issues/list

So you can make sure Erwin actually notices them and integrates them into the main branch when possible.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group