This project has moved and is read-only. For the latest updates, please go here.

Shapes Stability Decrease When PhysicsProccesor Increase Fast Perfomance

Jun 10, 2009 at 9:01 PM

Ok... the stabilty was improved on the source code Update...(Download on source code the link with the description: "Updating all AssemblyInfo.cs files to be version 2.1 and have correct description") but now if i increase value of the line:


_physicsSimulator.Update(Math.Min(_iterateParam.GameTime.ElapsedGameTime.Milliseconds, 100)*.001f);


_physicsSimulator.Update(Math.Min(_iterateParam.GameTime.ElapsedGameTime.Milliseconds, 100)*.003f);

(this change makes the physics looks very realistic(fast) but it decrease the stability)

the new question is.... How can i keep my stabilty and dont loose the fast perfomance???




Iteration = 10;

Jun 10, 2009 at 9:45 PM

Have in mind that the demo from advanced samples demonstrate multithreading working together with the physics engine. You might be better off using Demo4 from the Simple samples - it also contains a pyramid, but it is without all the multithreading stuff.

Anyway, if your update loop runs at 100 fps, you will have a updatetime of 10 ms. A timestep of 10*0.001 gives a smooth physics simulation because it only advances a small step each update. If you give it 10*0.003, you will have a less smooth simulation, but also more inaccurate. (in terms of physics engine accuracy). You need to crank up the iterations if you want a more accurate simulation.

Try experimenting a little - it takes some tweaking to get it just right. It is a compromise between performance and realistic physics.