]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/heading_indicator_dg.cxx
Projection matrix and texture size should be coherent
[flightgear.git] / src / Instrumentation / heading_indicator_dg.cxx
index eb8726c8971d330c3ce204b49e2546ae642349bd..d9923c2e556816642d228e7cfec095169fef08b0 100644 (file)
@@ -1,5 +1,5 @@
 // heading_indicator_dg.cxx - a Directional Gyro (DG) compass.
-// Based on the vacuum driven Heading Indicator Written by David Megginson, 
+// Based on the vacuum driven Heading Indicator Written by David Megginson,
 // started 2002.
 //
 // Written by Vivian Meazza, started 2005.
@@ -7,8 +7,8 @@
 // This file is in the Public Domain and comes with no warranty.
 
 #include <simgear/compiler.h>
-#include STL_IOSTREAM
-#include STL_STRING
+#include <iostream>
+#include <string>
 #include <sstream>
 
 #include <Main/fg_props.hxx>
@@ -108,7 +108,7 @@ HeadingIndicatorDG::update (double dt)
 
                                 // Next, calculate the indicated heading,
                                 // introducing errors.
-    double factor = 0.01 / (spin * spin * spin * spin * spin * spin);
+    double factor = 100 * (spin * spin * spin * spin * spin * spin);
     double heading = _heading_in_node->getDoubleValue();
 
                                 // Now, we have to get the current
@@ -119,7 +119,7 @@ HeadingIndicatorDG::update (double dt)
     while ((heading - _last_heading_deg) < -180)
         _last_heading_deg -= 360;
 
-    heading = fgGetLowPass(_last_heading_deg, heading, dt/factor);
+    heading = fgGetLowPass(_last_heading_deg, heading, dt * factor);
     _last_heading_deg = heading;
 
     heading += offset;