Pausing simulation neatly.

EnlightenedOne
Posts: 37
Joined: Wed Sep 08, 2010 2:57 pm

Pausing simulation neatly.

Post by EnlightenedOne »

Hi there,

I have been looking around and have hit a problem, as bullet uses an internal clock to account for time I cannot find a method for pausing the internal clock or updating it without stepping the simulation!

I thought it was "setInternalTickCallback" on dynamic world but that turned out to be plain bad intuition.

Here is a part of the loop in my physics thread.

//All physics data only gets updated if the world is not paused.
if (pSceneData->getBoolIsScenePaused() == false)
{
//Run things here.
dynamicsWorld->stepSimulation(fltDeltaTime * 1000, 10);
}
else
{
dynamicsWorld->stepTimeWithoutSimulation(fltDeltaTime * 1000);
}

I am still implementing other bits of the physics engine at the moment but if there is a logical way of doing this without me reinventing the wheel based on the code in step simulation I would be pleased to hear it. If no one posts I will post what I end up with when I get to it.

Many Thanks

EnlightenedOne
EnlightenedOne
Posts: 37
Joined: Wed Sep 08, 2010 2:57 pm

Re: Pausing simulation neatly.

Post by EnlightenedOne »

appears ignoring the step in simulation works without it trying to catchup when the internal timer sees a time delay difference. Good stuff forget this question :)