Box Box Collider - ODE style or GJK?

Please don't post Bullet support questions here, use the above forums instead.
Post Reply
sphet
Posts: 38
Joined: Mon May 06, 2013 6:14 pm

Box Box Collider - ODE style or GJK?

Post by sphet »

Hello,

Looking at a number of physics engines it seems that some use an explicit box-box collider, while others use GJK. Bullet appears to support both, with the Box v Box from ODE being used as default.

What are the pros and cons of these two approaches? Is there any documentation or description of the technique ODE uses - it appears to be SAT? Our engine supports persistent manifolds, so I would assume GJK and Box v Box would ultimately generate the same point set.

Has anyone experimented with exploiting frame coherence with either of these approaches?

I would like to implement an effective and robust solution so input and experiences would be appreciated.

Best,

S
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: Box Box Collider - ODE style or GJK?

Post by Dirk Gregorius »

Essentially there are two approaches: Incremental and full manifolds.

With incremental manifolds you find one contact per frame (e.g. using GJK) and build your manifold over time. The problem with this approach is that you need 4 frames until you have a stable manifold. A manifold is stable when the center of mass projects inside the manifold. Say you have a box. In the first frame you find one corner point. This creates an artificial torque which often looks awkward. In the second frame you will find the next point on the other side of box. This is still not stable since the box can rotate around the line between the contact points and potentially tunnel out of the world. In practice many artists are complaining about the artificial torque. It makes objects to appear very light weight and this is sometimes called the Styrofoam effect therefore. The tunneling is a major problem since you don't want objects to tunnel out of the world under any circumstances. So you start working around this with speculative contacts which makes a simple problem rather complex. You don't want to go into this direction. You solve one problem and get five new ones :)

For direct manifolds you find the axis of minimum penetration and then build contact points using clipping. You can use SAT, GJK or EPA, but it seems SAT is the more popular choice for this. As e.g. the ODE box/box collider. The full manifold solves the two problems mentioned above. I gave a presentation at the GDC about the SAT version between convex polyhedra this year. The presentation is a bit dense so I also released some source code. You kind find it here: https://box2d.googlecode.com/files/DGre ... DC2013.zip
sphet
Posts: 38
Joined: Mon May 06, 2013 6:14 pm

Re: Box Box Collider - ODE style or GJK?

Post by sphet »

Dirk,

Thanks again for your input.

I've implemented a persistent contact manifold that accepts incremental or full manifolds. My first attempt at using contacts from GJK show the artificial torque, as expected. I'll look into the clipping approach next. Thanks for the zip file.

Making great progress — now I just need to get this stuff running fast enough on handhelds.

Best,

S
Post Reply