0x00000000007e96fe in HeadingIndicator::update (this=0xc322430, dt=0)
at src/Instrumentation/heading_indicator.cxx:90
90          double factor = 0.01 / (spin * spin * spin * spin * spin * spin);

Similar lines at mrg.cxx:157, heading_indicator_fg.cxx:112 and
heading_indicator_dg.cxx:111
Apparently this value is only used as dt / factor, so we can get rid
of both divisions.
Note, this still leaves one instance at mrg.cxx:157 unfixed, suggestions?

-- 
Csaba/Jester
Index: src/Instrumentation/heading_indicator.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Instrumentation/heading_indicator.cxx,v
retrieving revision 1.11
diff -u -r1.11 heading_indicator.cxx
--- src/Instrumentation/heading_indicator.cxx	25 Jul 2008 18:38:31 -0000	1.11
+++ src/Instrumentation/heading_indicator.cxx	2 Jan 2009 16:37:28 -0000
@@ -87,7 +87,7 @@
 
                                 // 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
@@ -98,7 +98,7 @@
     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;
Index: src/Instrumentation/heading_indicator_dg.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Instrumentation/heading_indicator_dg.cxx,v
retrieving revision 1.3
diff -u -r1.3 heading_indicator_dg.cxx
--- src/Instrumentation/heading_indicator_dg.cxx	25 Jul 2008 18:38:31 -0000	1.3
+++ src/Instrumentation/heading_indicator_dg.cxx	2 Jan 2009 16:37:28 -0000
@@ -108,7 +108,7 @@
 
                                 // 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 @@
     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;
Index: src/Instrumentation/heading_indicator_fg.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/Instrumentation/heading_indicator_fg.cxx,v
retrieving revision 1.3
diff -u -r1.3 heading_indicator_fg.cxx
--- src/Instrumentation/heading_indicator_fg.cxx	25 Jul 2008 18:38:31 -0000	1.3
+++ src/Instrumentation/heading_indicator_fg.cxx	2 Jan 2009 16:37:28 -0000
@@ -109,7 +109,7 @@
 
                                 // 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
@@ -120,7 +120,7 @@
     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;
------------------------------------------------------------------------------
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to