unclepauly
02-10-2006 17:27:21
my car does about 85km/h max in my app (which has a detailed terrain), but if i change the terrain to something simple, like a pure flat terrain, it can only do about 60km/h.
can anyone offer an explanation? the only difference is that the more detailed terrain gives the app a frame rate of about 20fps, and the less detailed terrian gives the app a frame rate of about 35 fps.
so it looks like the less fps, the faster my car is! i think this is strange.
unclepauly
02-10-2006 17:32:33
ok, ignore this, i think it is because the 'flat' terrain actually went uphill a little bit, causing the slow-down...
Sweenie
06-10-2006 10:56:22
If you update Newton at the same rate as your current render rate, bodies will go slower at higher framerates.
This is due to the default linear & angular damping in Newton.
The higher the updaterate, the more damping is applied to the bodies.
For best stability & predictable behaviour you should update Newton in fixed timesteps, that is, decouple the physicupdates from the rendering updates.
unclepauly
06-10-2006 13:41:13
that makes sense, but i am using Ogre::Newt::BasicFrameListener, which in the .h file, it says
this is a simple Ogre FrameListener that will update the Newton world you supply it
with, at a desired framerate, using a simple time-slicer. this means the simulation
should run at the same speed regardless of the actual framerate. set the update_framerate
to a higher value for a more accurate simluation.
and in the .cpp file i can see it uses the method you describe.
is there a better way?
Sweenie
06-10-2006 15:32:10
Aha, didn't know OgreNewt could do that for you.
Well, in that case it must have been the tilting terrain.