On 10/24/07, leee  wrote:
>
> Hmm... I always thought that it ran asynchronously from the rest of FG,
> at a steady rate.  Surely this can't be a good thing?
>
> It really seems to me that the only subsystem in FG where variable
> timing won't cause a problem is the display, where it doesn't matter if
> you're seeing 25 fps or 60 fps, or anything in between.


Here's a quick explanation.

The FDM runs at 120 hertz and with a fixed time step.

However, we play one small trick to make that happen.  We take the time that
has elapsed since the last frame, compute how many whole iterations of the
FDM will fit in that time slice (at 1/120th of a second per iteration.)
Then we invoke the FDM that many times with a time step of 1/120th of a
second.  Finally we save out the remainder and add that into the next time
slice.

This can produce a small amount of temporal jitter between the graphics and
the fdm if the graphics frame rates are not a diviser of 120.  In the best
case scenario, you've locked your graphics frame rate to 60 hz so the FDM
runs exactly 2 iterations every time it is invoked and there is no temporal
jitter at all, ever.

One thing to keep in mind is that handing a different size time slice to the
FDM every frame (and sometimes that time slice could be 1 second or more?)
can lead to instabilities in the math.  So our approach is intended to avoid
that potential problem.  As far as the FDM is concerned, it *is* running
asyncronously, at a fixed time step.  But, we are playing a little trick on
the FDM (it doesn't care) in order to handle the unfortunate possibility of
non-fixed and highly variable frame rates on PC hardware running consumer
grade operating systems.

Regards,

Curt.
-- 
Curtis Olson: http://baron.flightgear.org/~curt/
Unique text: 2f585eeea02e2c79d7b1d8c4963bae2d
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to