]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/turn_indicator.cxx
Make the turn indicator more responsive.
[flightgear.git] / src / Instrumentation / turn_indicator.cxx
index 7e56b5b346a8ed49098ff5f603a8c44ff32dde8b..84bfdbdf81661fcb0434bb3cd44a3c79fee7d7e0 100644 (file)
@@ -8,7 +8,13 @@
 #include <Main/util.hxx>
 
 
-TurnIndicator::TurnIndicator ()
+// Use a bigger number to be more responsive, or a smaller number
+// to be more sluggish.
+#define RESPONSIVENESS 1.0
+
+
+TurnIndicator::TurnIndicator () :
+    _last_rate(0)
 {
 }
 
@@ -64,9 +70,7 @@ TurnIndicator::update (double dt)
 
                                 // Lag left, based on gyro spin
     rate = -2.5 + (factor * (rate + 2.5));
-
-                                // Add a lag, based on gyro spin
-    rate = fgGetLowPass(_last_rate, rate, dt/factor);
+    rate = fgGetLowPass(_last_rate, rate, dt*RESPONSIVENESS);
     _last_rate = rate;
     
                                 // Publish the indicated rate