]> git.mxchange.org Git - flightgear.git/commitdiff
Added getAGL()
authorcurt <curt>
Fri, 28 Apr 2000 20:08:22 +0000 (20:08 +0000)
committercurt <curt>
Fri, 28 Apr 2000 20:08:22 +0000 (20:08 +0000)
src/Main/bfi.cxx
src/Main/bfi.hxx

index 13f1b18331bcad12581f576f3f25fa226041ab11..14b66bc9c6f504d48ad96a67a868a1e02ee74b92 100644 (file)
@@ -37,6 +37,7 @@
 #include <Aircraft/aircraft.hxx>
 #include <Controls/controls.hxx>
 #include <Autopilot/autopilot.hxx>
+#include <Scenery/scenery.hxx>
 #include <Time/fg_time.hxx>
 #include <Time/light.hxx>
 #include <Cockpit/radiostack.hxx>
@@ -307,6 +308,18 @@ FGBFI::getAltitude ()
 }
 
 
+
+/**
+ * Return the current altitude in above the terrain.
+ */
+double
+FGBFI::getAGL ()
+{
+  return current_aircraft.fdm_state->get_Altitude()
+        - scenery.cur_elev * METER_TO_FEET;
+}
+
+
 /**
  * Set the current altitude in feet.
  */
index c295823d3c1acc60d106e484bdb23b322390e214..7fb7c6d274405f01299cd7ce96e2b548214ae8b4 100644 (file)
@@ -65,6 +65,7 @@ public:
   static double getLatitude ();
   static double getLongitude ();
   static double getAltitude ();
+  static double getAGL ();
 
   static void setLatitude (double latitude);
   static void setLongitude (double longitude);