]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/heading_indicator.cxx
Prepare and implement reinit methods for instruments
[flightgear.git] / src / Instrumentation / heading_indicator.cxx
index 2cbbb9f2469b31e9fbf2dd39e318d24a17d8d3fa..12daafb8a6288734e712fa789455f25730795fde 100644 (file)
@@ -9,6 +9,7 @@
 
 #include <simgear/compiler.h>
 #include <simgear/sg_inlines.h>
+#include <simgear/math/SGMath.hxx>
 #include <iostream>
 #include <string>
 #include <sstream>
@@ -47,8 +48,16 @@ HeadingIndicator::init ()
     _heading_out_node = node->getChild("indicated-heading-deg", 0, true);
     _heading_bug_error_node = node->getChild("heading-bug-error-deg", 0, true);
     _heading_bug_node = node->getChild("heading-bug-deg", 0, true);
+
+    reinit();
+}
+
+void
+HeadingIndicator::reinit ()
+{
     _last_heading_deg = (_heading_in_node->getDoubleValue() +
                          _offset_node->getDoubleValue());
+    _gyro.reinit();
 }
 
 void