Crystal Space
Welcome, Guest. Please login or register.
November 18, 2017, 04:32:31 pm

Login with username, password and session length
Search:     Advanced search
9081 Posts in 2051 Topics by 80399 Members
Latest Member: Unazinun32
* 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 2580 times)
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:

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.

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.199 seconds with 15 queries.