]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/flight.cxx
Fix stall widths for the "auxilliary" (reverse flow) stalls so they
[flightgear.git] / src / FDM / flight.cxx
index cedeb29a760ee1da97fd0b68682813f1880464fa..43b5aa03b62d6b21084263e2717e0c9c82e92403 100644 (file)
@@ -314,6 +314,8 @@ FGInterface::bind ()
   fgSetArchivable("/position/ground-elev-m");
   fgTie("/position/ground-elev-m", this,
         &FGInterface::get_Runway_altitude_m); // read-only
+  fgTie("/environment/ground-elevation-m", this,
+        &FGInterface::get_Runway_altitude_m); // read-only
   fgSetArchivable("/position/sea-level-radius-ft");
   fgTie("/position/sea-level-radius-ft", this,
         &FGInterface::get_Sea_level_radius); // read-only
@@ -452,6 +454,7 @@ FGInterface::unbind ()
   fgUntie("/position/altitude-agl-ft");
   fgUntie("/position/ground-elev-ft");
   fgUntie("/position/ground-elev-m");
+  fgUntie("/environment/ground-elevation-m");
   fgUntie("/position/sea-level-radius-ft");
   fgUntie("/orientation/roll-deg");
   fgUntie("/orientation/pitch-deg");
@@ -512,9 +515,7 @@ void FGInterface::_updateGeodeticPosition( double lat, double lon, double alt )
     _set_Geodetic_Position( lat, lon, alt );
 
     _set_Sea_level_radius( sl_radius * SG_METER_TO_FEET );
-    double alt_m = alt*SG_FEET_TO_METER;
-    double groundlevel_m = get_groundlevel_m(lat, lon, alt_m);
-    _set_Runway_altitude( groundlevel_m * SG_METER_TO_FEET );
+    _update_ground_elev_at_pos();
 
     _set_sin_lat_geocentric( lat_geoc );
     _set_cos_lat_geocentric( lat_geoc );
@@ -551,9 +552,7 @@ void FGInterface::_updateGeocentricPosition( double lat_geoc, double lon,
     _set_Geodetic_Position( lat_geod, lon, alt );
 
     _set_Sea_level_radius( sl_radius2 * SG_METER_TO_FEET );
-    double alt_m = alt*SG_FEET_TO_METER;
-    double groundlevel_m = get_groundlevel_m(lat_geod, lon, alt_m);
-    _set_Runway_altitude( groundlevel_m * SG_METER_TO_FEET );
+    _update_ground_elev_at_pos();
 
     _set_sin_lat_geocentric( lat_geoc );
     _set_cos_lat_geocentric( lat_geoc );
@@ -563,6 +562,13 @@ void FGInterface::_updateGeocentricPosition( double lat_geoc, double lon,
     _set_sin_cos_latitude( lat_geod );
 }
 
+void FGInterface::_update_ground_elev_at_pos( void ) {
+    double lat = get_Latitude();
+    double lon = get_Longitude();
+    double alt_m = get_Altitude()*SG_FEET_TO_METER;
+    double groundlevel_m = get_groundlevel_m(lat, lon, alt_m);
+    _set_Runway_altitude( groundlevel_m * SG_METER_TO_FEET );
+}
 
 // Extrapolate fdm based on time_offset (in usec)
 void FGInterface::extrapolate( int time_offset ) {