Twitching compound shape on terrain

Post Reply
Misterblue
Posts: 14
Joined: Wed Apr 28, 2010 3:09 pm

Twitching compound shape on terrain

Post by Misterblue »

I have complex shapes (meshes in a compound shape) that sit on terrain (btHeightFieldTerrainShape). My problem is that, if the shape sits on the ground in multiple places, the shape will twitch and jiggle and never deactivate.

Think of a four legged chair. The problem seems to be that gravity is pressing the shape down and the penetration recovery code is pushing each of the chair legs up. But since the chair is asymmetrical, the penetration recovery force applied upward on each leg is uneven. Thus the chair jiggles as each leg penetrates and recovers independently.

Question for the forum: how to fix this? I've tried damping, changing mass of the shape, and various other object parameters. Since I want to move the shape by applying forces to it, I cannot just zero out inertia and/or angular factors.

How is this sort of thing usually solved?

-- mb
dern23
Posts: 26
Joined: Thu Oct 04, 2012 1:58 pm

Re: Twitching compound shape on terrain

Post by dern23 »

Have you tried scaling the shape dimensions, gravity, etc. by a factor of say, 10 or 100? This can sometimes help with problems such as these. See the wiki page http://bulletphysics.org/mediawiki-1.5. ... _The_World, don't forget the note in the forum post linked at the bottom of that page about scaling inertia by X^2.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Twitching compound shape on terrain

Post by Erwin Coumans »

The first thing is to reproduce the problem by modifying one of the Bullet demos. Sometimes it works by serializing your world into a .bullet file, zip and attach it to a topic, but heightfield shapes are not serialized yet I think.

Once it is reported, someone can check it out and either give advise or fix the Bullet code.
Thanks a lot!
Erwin
Post Reply