Help: Rigid Bodies Shaking and falling without interaction

User avatar
Garibalde
Posts: 44
Joined: Fri Dec 18, 2009 6:06 pm
Location: Montreal

Help: Rigid Bodies Shaking and falling without interaction

Post by Garibalde »

I am having a problem when i start place cuboid shaped bodies in a row (using a Box collision shape). the object are close together but not touching each other. These objects are placed on a plane which is static
and has zero mass (it should not move).

What i observe is that after sometime it seems that the cuboid shapes will move slowing and collide with each other.

In another case i placed these objects on stairs i created. eventually these object fall of the stairs without
any user interaction.

it there a way to prevent this from occuring. I have tried to increase the timestep and this has not helpped it has improved a bit, but eventualy the scene becomes unstable (i.e everything collides).

Any help would be greatly appricated.

Thanks
User avatar
Garibalde
Posts: 44
Joined: Fri Dec 18, 2009 6:06 pm
Location: Montreal

Re: Help: Rigid Bodies Shaking and falling without interacti

Post by Garibalde »

Seems that the issue of the objects shaking is when i switch an object from Dynamics to Kinematic control and again back to dynamic control. This causes the switched body to become shakey!!

it seems that once back in dynamics mode it casues some sort of jitter. I will investigate further.

If anyone has any ideas, let me know.

Thanks
User avatar
Garibalde
Posts: 44
Joined: Fri Dec 18, 2009 6:06 pm
Location: Montreal

Re: Help: Rigid Bodies Shaking and falling without interacti

Post by Garibalde »

Nope this problem seems random...

Can anyone provide any thought into the problem? if i load the simulation with stacked boxes everthing is fine once switch a body to kinematics in the stack and back to dynamics.. the dynamics bodies never come to rest.. they keep shaking until the stack collapes?

Someone must have tried to stack a bunch of boxes and seen if they are stable??? I cant be the first :)

I have also noticed that the input timestep into stepSimulation is not contant its a function of the framerate in ogre which is "timeSinceLastFrame". which can in some points change drastically.. would this effect the dynamic simulation and cause instability... if so is there a way to smooth out the input timestep?

Any help would be great.

Thanks
winspear
Posts: 77
Joined: Thu Nov 26, 2009 6:32 pm

Re: Help: Rigid Bodies Shaking and falling without interacti

Post by winspear »

Just use default values when initializing the physics simulation and you should be fine. I found that this happens when you mess around with the physics simulation values like m_erp, m_splitImpulse, m_maxErrorReduction , m_numIterations etc., so just don't initialize any of these values and let them be default.
Initialize with default values as follows and you should be doing ok.

Code: Select all

btDynamicsWorld* m_world;
btDefaultCollisionConfiguration* m_collisionConfiguration;
btCollisionDispatcher* m_dispatcher;
btDbvtBroadphase* m_broadphase;
btSequentialImpulseConstraintSolver* m_solver;

m_collisionConfiguration = new btDefaultCollisionConfiguration();
m_dispatcher = new btCollisionDispatcher( m_collisionConfiguration );
m_broadphase = new btDbvtBroadphase();
m_solver = new btSequentialImpulseConstraintSolver();
m_world = new btDiscreteDynamicsWorld( m_dispatcher, m_broadphase, m_solver, m_collisionConfiguration );
m_world->setGravity( btVector3(0.0,-9.8,0.0);

User avatar
Garibalde
Posts: 44
Joined: Fri Dec 18, 2009 6:06 pm
Location: Montreal

Re: Help: Rigid Bodies Shaking and falling without interacti

Post by Garibalde »

Thanks very much
I will give this a shot tonight and post the results.

Thanks