Problem while FPS < 60

dedesite

14-08-2008 11:57:34

Hi all, I've got big problem in my game when the FPS is under 60 : the wheel of my car (which the position depend on the centerOfMassPosition of the chassis) aren't following the chassis. They shift on the left when I turn left, on the right when I turn right, behind when I go straight forward etc.

I think the problem comes from the fixedTimeStep which is at 1/60 (so 60FPS) but if I set it to 1/30, it doesn't change anything.
I've try to step the simulation several time in the same frame like that :


if(GameApplication::getSingleton().getCurrentFPS() > 60.0f)
{

PhysicManager::getSingleton().stepSimulation(evt.timeSinceLastFrame);
}
else
{
int numIter = 40;
for(int i = 0 ; i < numIter ; i++)
{
PhysicManager::getSingleton().stepSimulation(evt.timeSinceLastFrame/numIter);
}
}


But again, no change... Have you got an idea??

Greetings,

Andréas

SiWi

25-08-2008 16:03:18

Well, late answer, but try to set 5 for the second parameter of step simulation. Leave fixedtimeStep at 60hz though.

dedesite

25-08-2008 19:39:17

Ok, thanks for your repply, I'm on vacation this week, but I'll try next monday ;).

Greetings,

Andréas