realy small (>0.01 bounds) rigidbodies (almost) never settle

cgripeos
Posts: 20
Joined: Mon Sep 24, 2007 5:45 am

realy small (>0.01 bounds) rigidbodies (almost) never settle

Post by cgripeos »

Hi,

I have a dynamic RigidBody using a btBoxShape or 0.01 extends that seems to never settle when dropped on a static RigidBody (lets call this body the ground). In fact the dynamic Rigidbody seems to shake and pop around the ground.

The shape of the ground does not seem to make much difference. I've tried making the ground a convex hull and a simple btBoxShape and the results are almost the same. The dynamic Rigidbody either never settles or just shakes and moves around the surface of the ground.

You can observe the problem using Bullet 2.81-rev2613 App_CcdPhysicsDemo by doing the following:

in .\bullet-2.81-rev2613\Demos\CcdPhysicsDemo\CcdPhysicsDemo.cpp

- set CUBE_HALF_EXTENTS to 0.01 (from 1.0)
- move the camera closer by setCameraDistance(btScalar(2.)) on line 44

and in .\bullet-2.81-rev2613\Demos\OpenGL\DemoApplication.cpp

- on line 66 set m_ele(40.f) (raise the camera higher so we can zoom in)

Run the app and notice the boxes never settle once dropped.

Any help resolving this would be greatly appreciated,

cg
rtrius
Posts: 43
Joined: Sat May 26, 2012 1:09 am

Re: realy small (>0.01 bounds) rigidbodies (almost) never se

Post by rtrius »

The wiki has some information on this: http://bulletphysics.org/mediawiki-1.5. ... _The_World
In particular, see the forum post under references.

In short, it is necessary to either upscale the world, or use a smaller time step e.g.

Code: Select all

m_dynamicsWorld->stepSimulation( btScalar(1.0/300.0), 0 );
cgripeos
Posts: 20
Joined: Mon Sep 24, 2007 5:45 am

Re: realy small (>0.01 bounds) rigidbodies (almost) never se

Post by cgripeos »

Thank you!
cgripeos
Posts: 20
Joined: Mon Sep 24, 2007 5:45 am

Re: realy small (>0.01 bounds) rigidbodies (almost) never se

Post by cgripeos »

I tried to time slice my dt all the way up to 300 times, still no good. Small RBs just jitter around.
My project is still stuck on the Bullet 2.78 build. I'll try this on the latest build's demo code and see what happens.
rtrius
Posts: 43
Joined: Sat May 26, 2012 1:09 am

Re: realy small (>0.01 bounds) rigidbodies (almost) never se

Post by rtrius »

Running a second test on bullet-2.81-rev2613, there does indeed
seem to be some (very small) jitter when using a 300hz timestep.
Upscaling the world(1 m == 1 cm, gravity == -1000) does not seem to improve the situation.

Using a 600hz timestep helps, but reduces performance further.

Reducing the gravity to 1/3 also seems to substantially improve the results; try:

Code: Select all

m_dynamicsWorld->stepSimulation( btScalar(1.0/300.0), 0 );
m_dynamicsWorld->setGravity( btVector3(0, -3.0, 0) );
If the above settings work, but normal gravity is a requirement,
a potential solution might be to reduce the gravity only when
rigid bodies are touching or near the ground(have not tested this though).