From: andy Date: Mon, 26 Jun 2006 17:59:58 +0000 (+0000) Subject: Patch from Mathias: unify the AGL altitude with the other FDMs, but preserve the... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a6661b43e0925a9032e47dcb79d9ab0f8a7baf54;p=flightgear.git Patch from Mathias: unify the AGL altitude with the other FDMs, but preserve the distance-to-touchdown metric in the gear-agl properties. --- diff --git a/src/FDM/YASim/YASim.cxx b/src/FDM/YASim/YASim.cxx index 02c54174d..924399afe 100644 --- a/src/FDM/YASim/YASim.cxx +++ b/src/FDM/YASim/YASim.cxx @@ -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);