box-on-plane jitters, box-on-box doesn't

User avatar
ejtttje
Posts: 96
Joined: Mon Nov 03, 2008 9:57 pm

box-on-plane jitters, box-on-box doesn't

Post by ejtttje »

I think I'm running into a variation of this post: http://bulletphysics.com/Bullet/phpBB3/ ... f=9&t=3858

I have a small box with strong gravity. At "standard" gravity of 9.8, the box is a cube, 0.03 on a side. I know this is small and would have trouble with various parameters, so I scale the world (i.e. both cube dim and gravity) up by a factor. But regardless of the scaling magnitude (10, 100, 1000), I still have the same jitter when I drop the cube on a plane. It tends twirl around in little circles. The mass of the cube does not seem to have any effect, it seems entirely an issue of the ratio of gravity to the cube dimension—bigger cubes or smaller gravity by a factor of 2 greatly reduce the jitter, do much more and it disappears altogether.

Alternatively, if I increase the collision margin to at least .003 * scale, then it stops jittering. It still takes a little time to settle down, but at least it does so.

The weird thing is that if I drop the cube on a large static box instead of the plane, it settles immediately and works with the default settings at a scale factor of 10.

So the question is, what is the plane doing that makes it unstable vs. a large box, and what is the best way to fix it? The collision margin solution isn't very satisfactory because it still bounces around a little. I tried to set the linear and angular damping to around .1 or .01, and that actually seems to make things worse. (Is there a way to set/increase m_numPerturbationIterations or m_minimumPointsPerturbationThreshold as referenced in the thread above?)

Thanks!
User avatar
ejtttje
Posts: 96
Joined: Mon Nov 03, 2008 9:57 pm

Re: box-on-plane jitters, box-on-box doesn't

Post by ejtttje »

ejtttje wrote:(Is there a way to set/increase m_numPerturbationIterations or m_minimumPointsPerturbationThreshold as referenced in the thread above?)
Ah, I discovered btDefaultCollisionConfiguration::setConvexConvexMultipointIterations(), but it turns out requesting 3,3 (before constructing btCollisionDispatcher in case that matters) does not actually affect my issue.