JITTER_REMOVAL, Capsule problems...

DevO
Posts: 95
Joined: Fri Mar 31, 2006 7:13 pm

JITTER_REMOVAL, Capsule problems...

Post by DevO »

Per default EXPERIMENTAL_JITTER_REMOVAL and FORCE_VELOCITY_DAMPING are enabled in btRigidBody but unfortunately this cause some problems.

First this code seems to be not time step independent, so if you will make some slow motion then all bodies will becoming sleeping instate moving slowly.

Second it seems to hide some collisions problems with Capsule or Cylinder vs Box shapes.
If you drop Capsule or Cylinder on static Box shape then long period jitter will begin.
Once positional Error goes against Zero it jump to really big value and then again...

Please try to look at this test below.
Disable both EXPERIMENTAL_JITTER_REMOVAL and FORCE_VELOCITY_DAMPING and try to set Capsule Damping to 0.0.

EDIT-1:
What is the purpose of gContactBreakingThreshold = btScalar(0.02); ???
It seems that depth will be accumulated until this 0.2 and the reseted to zero.
May be this is the problem???
You do not have the required permissions to view the files attached to this post.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: JITTER_REMOVAL, Capsule problems...

Post by Erwin Coumans »

DevO wrote:Per default EXPERIMENTAL_JITTER_REMOVAL and FORCE_VELOCITY_DAMPING are enabled in btRigidBody but unfortunately this cause some problems.

First this code seems to be not time step independent, so if you will make some slow motion then all bodies will becoming sleeping instate moving slowly.

Second it seems to hide some collisions problems with Capsule or Cylinder vs Box shapes.
If you drop Capsule or Cylinder on static Box shape then long period jitter will begin.
Once positional Error goes against Zero it jump to really big value and then again...
I will looking more in detail into the issue, that for your demo. Note that you disabled sleeping, by setting this threshold:

Code: Select all

body->setSleepingThresholds(0.0,0.0);
You can also just press 'd' to toggle sleeping on/off.

Also, please use the getNumContacts(), instead of '4' (the max size of the cache is 4, but they are not necessary valid or initialized).

Code: Select all

	//for (int i=0; i<4; ++i)
	for (int i=0; i<contactPointResult.getPersistentManifold()->getNumContacts(); ++i)

Code: Select all

//next line is not a good idea:
btCompoundShape* staticScenario = new btCompoundShape();//static scenario
It is not good habbit to use a compound shapes for static objects, it is not good for performance. It is better to just add the static objects directly into the broadphase, or if trianglemeshes, just in trianglemeshshape.
What is the purpose of gContactBreakingThreshold = btScalar(0.02);
It seems that depth will be accumulated until this 0.2 and the reseted to zero.
May be this is the problem???
As I mentioned, I will look deeper into the issue. Bullet uses persistent contact points, with various update rules. When the distance becomes larger then this contact breaking threshold, contacts are removed. This happens in btPersistentManifold::refreshContactPoints. There are some discussions on contact point generation on the forum, perhaps you can find those.

The persistent contact management is a bit too complicate to discuss thoroughly in this topic, but it should be documented in extensive detail. I'm working on this.

Can you make more clear what the problem is?
Thanks for the feedback,
Erwin