The addition of this code on 10/23 to fg_init.cxx is what started the problem
with the aircraft crashing on teleports:

   cout << "fgInitPosition()" << endl;
             double gs = fgGetDouble("/sim/presets/glideslope-deg")
                 * SG_DEGREES_TO_RADIANS ;
             double od = fgGetDouble("/sim/presets/offset-distance");
             double alt = fgGetDouble("/sim/presets/altitude-ft");

Further down in the funciton the onground flag gets set:

     // determine if this should be an on-ground or in-air start
             if ( fabs(gs) > 0.01 || fabs(od) > 0.1 || alt > 0.1 ) {
                 fgSetBool("/sim/presets/onground", false);
             } else {
                 fgSetBool("/sim/presets/onground", true);
             }
 
Is this an abuse of the property system (from a design standpoint)?  Somehow,
somewhere the altitude as determined by this routine (fgInitPosition) is
getting put into /sim/presets/altitude.  

If you select an airport,  the altitude of the starting position of that
airport gets placed into /sim/presets/altitude.   Then when you teleport the
above code detects the value, and sets "onground" to false.   This causes the
reinitialized aircraft to be dangled in the air at the altitude of the
previous airport.

Backing out this patch fixes the teleport problem.

Isn't the advantage/purpose of the property tree to offer and easy interface
through the command line, network connections, and configuration files? 
(Rather than short-cutting C++ class definitions, that is.)

Best,

Jim


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to