From a677ddac5d8a6be9184123bd611aa58343b3801d Mon Sep 17 00:00:00 2001 From: curt Date: Sat, 28 Sep 2002 04:00:55 +0000 Subject: [PATCH] Pass ground elevation at aircraft position to external FDM, not ground elevation at view point. --- src/FDM/ExternalNet.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/FDM/ExternalNet.cxx b/src/FDM/ExternalNet.cxx index fdf9bd7eb..132003fb6 100644 --- a/src/FDM/ExternalNet.cxx +++ b/src/FDM/ExternalNet.cxx @@ -120,7 +120,12 @@ static void global2raw( FGRawCtrls *raw ) { raw->master_alt = node->getChild("master-alt")->getBoolValue(); raw->master_avionics = node->getChild("master-avionics")->getBoolValue(); - raw->hground = fgGetDouble( "/environment/ground-elevation-m" ); + // cur_fdm_state->get_ground_elev_ft() is what we want ... this + // reports the altitude of the aircraft. + // "/environment/ground-elevation-m" reports the ground elevation + // of the current view point which could change substantially if + // the user is switching views. + raw->hground = cur_fdm_state->get_ground_elev_ft() * SG_FEET_TO_METER; raw->magvar = fgGetDouble("/environment/magnetic-variation-deg"); raw->speedup = fgGetInt("/sim/speed-up"); -- 2.39.5