X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fgyro.cxx;h=93fee30bedbb9354f51c0a1f014eda5d4dc3b034;hb=0a5e86f4e61a80ff19b78de011852a7b60250b7a;hp=3cb5b315213975604ee964d87f2c9cf98a786e7d;hpb=677c3e3e9ab9598c40a23cc89f99235d618b3a6f;p=flightgear.git diff --git a/src/Instrumentation/gyro.cxx b/src/Instrumentation/gyro.cxx index 3cb5b3152..93fee30be 100644 --- a/src/Instrumentation/gyro.cxx +++ b/src/Instrumentation/gyro.cxx @@ -26,6 +26,8 @@ Gyro::update (double delta_time_sec) double step = 0.25 * _power_norm * delta_time_sec; if ((_spin_norm + step) <= _power_norm) _spin_norm += step; + } else { + _spin_norm = 0; // stop right away if the gyro breaks } // clamp the spin to 0.0:1.0