]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/flight.cxx
Avoid a potential segfault.
[flightgear.git] / src / FDM / flight.cxx
index c51e2b83ed84a5946c824cb3ad7d99d19d08c8a7..567190ea17a7a0ad10d34830df116bca9a5ce206 100644 (file)
@@ -391,14 +391,31 @@ FGInterface::bind ()
   fgTie("/velocities/glideslope", this,
   &FGInterface::get_Gamma_vert_rad,
   &FGInterface::set_Gamma_vert_rad );
-  fgTie("/velocities/side-slip-rad", this,
+  fgTie("/orientation/side-slip-rad", this,
        &FGInterface::get_Beta); // read-only
-  fgTie("/velocities/side-slip-deg", this,
+  fgTie("/orientation/side-slip-deg", this,
   &FGInterface::get_Beta_deg); // read-only
-  fgTie("/velocities/alpha-deg", this,
+  fgTie("/orientation/alpha-deg", this,
   &FGInterface::get_Alpha_deg); // read-only
   fgTie("/accelerations/nlf", this,
   &FGInterface::get_Nlf); // read-only
+
+                                // NED accelerations
+  fgTie("/accelerations/ned/north-accel-fps_sec",
+        this, &FGInterface::get_V_dot_north);
+  fgTie("/accelerations/ned/east-accel-fps_sec",
+        this, &FGInterface::get_V_dot_east);
+  fgTie("/accelerations/ned/down-accel-fps_sec",
+        this, &FGInterface::get_V_dot_down);
+
+                                // Pilot accelerations
+  fgTie("/accelerations/pilot/x-accel-fps_sec",
+        this, &FGInterface::get_A_X_pilot);
+  fgTie("/accelerations/pilot/y-accel-fps_sec",
+        this, &FGInterface::get_A_Y_pilot);
+  fgTie("/accelerations/pilot/z-accel-fps_sec",
+        this, &FGInterface::get_A_Z_pilot);
+
 }
 
 
@@ -421,9 +438,9 @@ FGInterface::unbind ()
   fgUntie("/position/longitude-deg");
   fgUntie("/position/altitude-ft");
   fgUntie("/position/altitude-agl-ft");
-  fgUntie("/orientation/heading-deg");
-  fgUntie("/orientation/pitch-deg");
   fgUntie("/orientation/roll-deg");
+  fgUntie("/orientation/pitch-deg");
+  fgUntie("/orientation/heading-deg");
   fgUntie("/velocities/airspeed-kt");
   fgUntie("/velocities/speed-north-fps");
   fgUntie("/velocities/speed-east-fps");
@@ -437,7 +454,9 @@ FGInterface::unbind ()
   fgUntie("/velocities/side-slip-deg");
   fgUntie("/velocities/alpha-deg");
   fgUntie("/accelerations/nlf");
-  
+  fgUntie("/accelerations/pilot/x-accel-fps_sec");
+  fgUntie("/accelerations/pilot/y-accel-fps_sec");
+  fgUntie("/accelerations/pilot/z-accel-fps_sec");
 }
 
 /**
@@ -471,7 +490,9 @@ void FGInterface::_updateGeodeticPosition( double lat, double lon, double alt )
     _set_Geodetic_Position( lat, lon, alt );
 
     _set_Sea_level_radius( sl_radius * SG_METER_TO_FEET );
-    _set_Runway_altitude( getACModel()->get3DModel()->getFGLocation()->get_cur_elev_m() * SG_METER_TO_FEET );
+    if ( getACModel() != NULL ) {
+        _set_Runway_altitude( getACModel()->get3DModel()->getFGLocation()->get_cur_elev_m() * SG_METER_TO_FEET );
+    }
 
     _set_sin_lat_geocentric( lat_geoc );
     _set_cos_lat_geocentric( lat_geoc );