]> git.mxchange.org Git - flightgear.git/commit
Fix a class of problem that could lead to needless extra time "jitter" in the flight...
authorcurt <curt>
Wed, 26 Jul 2006 14:18:06 +0000 (14:18 +0000)
committercurt <curt>
Wed, 26 Jul 2006 14:18:06 +0000 (14:18 +0000)
commitf31088070cde907a0ec2702238582711dc3c6fa6
tree159189b9e33bda02a18b23db59493aa28d7a48dc
parent5d10e338d5d07ed17c6b820c6433b5d5dcfdd76f
Fix a class of problem that could lead to needless extra time "jitter" in the flight dynamics
calculations.  We run the FDM at 120hz and compute how many loops can fit into each FG loop.
Floating point rounding could lead to a situation where we could end up running
1, 3, 1, 3, 1, 3... loops of the FDM when in fact we want to run 2, 2, 2, 2, 2...

If we artificially inflate ml above by a tiny amount to get the
closest integer, then subtract the integer from the original
slightly smaller value, we can get a negative remainder.
Logically this should never happen, and we definitely don't want
to carry a negative remainder over to the next iteration, so
never let the remainder go below zero.
src/FDM/flight.cxx