]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/YASim/YASim.cxx
Use bool where the source and destination variable is bool.
[flightgear.git] / src / FDM / YASim / YASim.cxx
index 021931f1bc41955785d23fe7959f613012244d34..924399afea10e55a0d115c4ada7732c4abbdf985 100644 (file)
@@ -371,13 +371,17 @@ void YASim::copyFromYASim()
     double lat, lon, alt;
     sgCartToGeod(s->pos, &lat, &lon, &alt);
     _set_Geodetic_Position(lat, lon, alt*M2FT);
-    _update_ground_elev_at_pos();
+    double groundlevel_m = get_groundlevel_m(lat, lon, alt);
+    _set_Runway_altitude(groundlevel_m*SG_METER_TO_FEET);
+    _set_Altitude_AGL((alt-groundlevel_m)*SG_METER_TO_FEET);
+
+    // the smallest agl of all gears
+    fgSetFloat("/position/gear-agl-m", model->getAGL());
+    fgSetFloat("/position/gear-agl-ft", model->getAGL()*M2FT);
 
     // UNUSED
     //_set_Geocentric_Position(Glue::geod2geocLat(lat), lon, alt*M2FT);
 
-    _set_Altitude_AGL(model->getAGL() * M2FT);
-
     // useful conversion matrix
     float xyz2ned[9];
     Glue::xyz2nedMat(lat, lon, xyz2ned);
@@ -480,5 +484,9 @@ void YASim::copyFromYASim()
     if(l) {
        SGPropertyNode * node = fgGetNode("gear/launchbar", 0, true);
        node->setFloatValue("position-norm", l->getCompressFraction());
+        node->setFloatValue("holdback-position-norm", l->getHoldbackCompressFraction());
+        node->setStringValue("state", l->getState());
+        node->setBoolValue("strop", l->getStrop());
     }
+
 }