]> git.mxchange.org Git - flightgear.git/commitdiff
Fixes to initial position for JSBSim.
authorcurt <curt>
Sat, 3 Mar 2001 00:03:42 +0000 (00:03 +0000)
committercurt <curt>
Sat, 3 Mar 2001 00:03:42 +0000 (00:03 +0000)
src/FDM/JSBSim.cxx
src/FDM/flight.cxx

index 7707afe48050ba372a6490b345b3f34e0e5ce1d7..923ae1980097ae838273c7fad4992c44de95b6f7 100644 (file)
@@ -421,6 +421,7 @@ void FGJSBsim::set_Latitude(double lat) {
     
     snap_shot();
     sgGeodToGeoc( lat, get_Altitude() , &sea_level_radius_meters, &lat_geoc);
+    _set_Sea_level_radius( sea_level_radius_meters * METER_TO_FEET  );
     fgic->SetSeaLevelRadiusFtIC( sea_level_radius_meters * METER_TO_FEET  );
     fgic->SetLatitudeRadIC( lat_geoc );
     fdmex->RunIC(fgic); //loop JSBSim once
@@ -446,6 +447,7 @@ void FGJSBsim::set_Altitude(double alt) {
     
     snap_shot();
     sgGeodToGeoc( get_Latitude(), alt , &sea_level_radius_meters, &lat_geoc);
+    _set_Sea_level_radius( sea_level_radius_meters * METER_TO_FEET  );
     fgic->SetSeaLevelRadiusFtIC( sea_level_radius_meters * METER_TO_FEET );
     fgic->SetLatitudeRadIC( lat_geoc );
     fgic->SetAltitudeFtIC(alt);
index c015ee032c35cfbe731881e443504306e791be04..ec8707dc37a39ad1ebeb9ccfcf439c58e4b93898 100644 (file)
@@ -272,7 +272,7 @@ bool FGInterface::update( int multi_loop ) {
 void FGInterface::_updatePosition( double lat_geoc, double lon, double alt ) {
     double lat_geod, tmp_alt, sl_radius1, sl_radius2, tmp_lat_geoc;
        
-    sgGeocToGeod( lat_geoc, EQUATORIAL_RADIUS_M + alt * FEET_TO_METER,
+    sgGeocToGeod( lat_geoc, ( get_Sea_level_radius() + alt ) * FEET_TO_METER,
                  &lat_geod, &tmp_alt, &sl_radius1 );
     sgGeodToGeoc( lat_geod, alt * FEET_TO_METER, &sl_radius2, &tmp_lat_geoc );