Reducing Jitter and Penetration

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
ShadowyCore
Posts: 1
Joined: Tue Aug 04, 2009 1:51 pm

Reducing Jitter and Penetration

Post by ShadowyCore »

Hey everybody!

I have set up a world made up of ConvexHulls representing convex BSP brushes. I have a Box entity (will later be changed to another ConvexHull) that needs to collide with these brushes.

My problem originally was that my world was far too large, 64 units representing a single meter. I have since changed it to make 1:1 units to meters, but I'm still looking for the ideal ratio's for allowedPenetration and collisionMargin. Is there some magic number to make it look like the box is resting on a surface, without it passing through or causing jitter? Thanks!
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Reducing Jitter and Penetration

Post by Norbo »

If the involved objects are pretty normal (on the order of 1-20 units per individual entity), the default values for allowedPenetration (.005f) and collisionMargin (.04f) should work fine. In tests with convex hull collision, I don't notice any issues until I have a very large, thin convex hull of size around 200x1x200 colliding against a complicated randomized convex hull of size ~3x3x3. At this point, occasional tiny contact inaccuracies can be observed, but it is usually too minor to detect. If you want pretty much universally stable collision detection, it's a good idea to stick to smaller scales than that and simpler convex hulls. The randomized convex hull had about 30-60 surface triangles; the more complicated the surface is, the harder it can be for the system to get the contacts exactly right.
Post Reply