Crystal Space
Welcome, Guest. Please login or register.
September 02, 2014, 04:37:27 pm

Login with username, password and session length
Search:     Advanced search
9009 Posts in 2043 Topics by 8378 Members
Latest Member: Gwenlode
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  General Crystal Space Discussion
| | |-+  ODE and stability
« previous next »
Pages: [1] Print
Author Topic: ODE and stability  (Read 1795 times)
jorrit
Administrator
Hero Member
*****
Posts: 1706


View Profile
« on: July 15, 2005, 05:32:48 am »

Today I found an interesting bit of information in the ODE mailing
list archives:

Quote
0) make sure you're using a constant step size. If you vary your step
size at all, you will introduce jitter because of the ODE integrator,
even for bodies at rest (because "rest" means that the ground contact
cancels out the gravity acceleration for the current time step).

I was already experiencing problems with stability in the mechtest
demo that I recently added to CEL (to test the mechanics plugin). i.e.
objects would sometimes suddenly jump up slightly or move a small
amount. And then I found the message above in relation to that error.
So I fixed both the mechanics plugin and phystut so that they now have
a constant stepsize but STILL do framerate independent physics
simulation speed. Here is an example of how it works:

Assume that at some point you have elapsed time equal to 90ms and step
size is defined as 30ms. In that case for a given frame you would get
3 steps and everything is fine. However at another point you get an
elapsed time of 100ms. In that case you would get 3 steps of 30ms each
and then one step of 10ms to make sure the physics simulation really
accomodates 100ms. ODE doesn't like this because this makes the step
size variable. So what I do now instead is to do 3 steps of 30ms and
the 10ms I keep in a variable. Next frame I add that 10ms to the
elapsed time that is valid for that frame. That way no time is lost
but I make sure that the step size is constant.

This helps a great deal with stability.

Greetings,
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 5.198 seconds with 15 queries.