GImpact in Bullet 2.73 "freezes" simulation

faichele
Posts: 9
Joined: Wed Aug 27, 2008 7:56 am

GImpact in Bullet 2.73 "freezes" simulation

Post by faichele »

Hello!

I hope I've chosen the right subforum for my questions.

Using Bullet 2.73 with GImpact as collision algorithm, I run into an issue that I can't resolve:
I have a static box acting as ground plane and a rigid body using a concave collision geometry (see the attached screenshots); if I position the body about 30 "units" above the static box and just let it fall under the influence of gravity (-9,81 kg/ms^2 along the Z-axis), the simulation "freezes" after about 400 iterations of the Bullet engine; the application itself remains responsive (I use OpenSceneGraph for visualization), i. e. I can still move the camera around, but the rigid body seems to come to a "final rest", even if it is in the process of toppling over after hitting the ground. I have stepped into my simulation loop with a debugger to verify that the "stepSimulation" calls to Bullet still occur, and they definitely do.

I tried the same free-fall experiment with a simple cube from different heights, and these simulation runs didn't "freeze", but kept running until the cube came to a rest (I rotated the cube initially, so that it would bounce off the ground a few times after hitting the ground).

Most likely the issue is me overlooking some important parameter setting or using Bullet incorrectly in some other way; any suggestions and tips are highly welcome.

Thank you!

Fabian Aichele
screenshot_1.jpg
screenshot_2.jpg
You do not have the required permissions to view the files attached to this post.
ola
Posts: 169
Joined: Sun Jan 14, 2007 7:56 pm
Location: Norway

Re: GImpact in Bullet 2.73 "freezes" simulation

Post by ola »

Hi, you can try to disable deactivation of rigid bodies:

b->setActivationState(DISABLE_DEACTIVATION);

Or you can modify the threshold velocities for when bullet does deactivate a rigid body. The default values are a bit "aggressive", in order to deactivate as much as possible and save CPU.

from btRigidBody.h:
void setSleepingThresholds(btScalar linear,btScalar angular)
{
m_linearSleepingThreshold = linear;
m_angularSleepingThreshold = angular;
}

Hope that helps,
Ola
faichele
Posts: 9
Joined: Wed Aug 27, 2008 7:56 am

Re: GImpact in Bullet 2.73 "freezes" simulation

Post by faichele »

Hello!

Thank you very much, that did the trick! I'll stick with completely disabling deactivation for the time being.

With best regards,
Fabian Aichele
ola wrote:Hi, you can try to disable deactivation of rigid bodies:

b->setActivationState(DISABLE_DEACTIVATION);

Or you can modify the threshold velocities for when bullet does deactivate a rigid body. The default values are a bit "aggressive", in order to deactivate as much as possible and save CPU.

from btRigidBody.h:
void setSleepingThresholds(btScalar linear,btScalar angular)
{
m_linearSleepingThreshold = linear;
m_angularSleepingThreshold = angular;
}

Hope that helps,
Ola
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: GImpact in Bullet 2.73 "freezes" simulation

Post by sparkprime »

I wonder if sleeping should be disabled by default since it's only a performance feature and seems to confuse a lot of new users.
faichele
Posts: 9
Joined: Wed Aug 27, 2008 7:56 am

Re: GImpact in Bullet 2.73 "freezes" simulation

Post by faichele »

Hello!

Sleeping being turned on by default will have its reason, thinking of the time-frames one usually has available for physics processing in an interactive real-time application like a modern 3D computer game.
Remembering a presentation by a developer from Rockstar Games, about 25 - 30ms per game loop iteration = physics + graphics + AI. You need every possible optimization you can get there, as far as I can imagine.
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: GImpact in Bullet 2.73 "freezes" simulation

Post by sparkprime »

New users don't need performance, they need a simulation that works without having to be configured for their situation. Performance tuning always comes after getting things to work.