]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/LaRCsim.cxx
Additional failure modeling.
[flightgear.git] / src / FDM / LaRCsim.cxx
index 8051ef49f8166ab3799419fb33d7031c64643bae..b7bd00124b4d91d4f84818dea05af4c0b7ab2d1d 100644 (file)
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
 
-#include <Scenery/scenery.hxx>
 
 #include <Main/fg_props.hxx>
 #include <Aircraft/aircraft.hxx>
 #include <Controls/controls.hxx>
+#include <Model/model.hxx>
+#include <Main/location.hxx>
 #include <FDM/flight.hxx>
 #include <FDM/LaRCsim/ls_cockpit.h>
 #include <FDM/LaRCsim/ls_generic.h>
 #include <FDM/LaRCsim/ls_interface.h>
 #include <FDM/LaRCsimIC.hxx>
 #include <FDM/UIUCModel/uiuc_aircraft.h>
+#include <Model/acmodel.hxx>
 
 #include "IO360.hxx"
 #include "LaRCsim.hxx"
 
+
 FGLaRCsim::FGLaRCsim( double dt ) {
 //     set_delta_t( dt );
 
@@ -188,8 +191,7 @@ void FGLaRCsim::update( double dt ) {
 
     // Inform LaRCsim of the local terrain altitude
     // Runway_altitude = get_Runway_altitude();
-    Runway_altitude = scenery.get_cur_elev() * SG_METER_TO_FEET;
-
+    Runway_altitude = getACModel()->get3DModel()->getFGLocation()->get_cur_elev_m() * SG_METER_TO_FEET;
     // Weather
     /* V_north_airmass = get_V_north_airmass();
        V_east_airmass =  get_V_east_airmass();
@@ -569,7 +571,7 @@ bool FGLaRCsim::copy_from_LaRCsim() {
             globals->get_controls()->set_rudder(Rudder_pedal);
             //   controls.set_rudder(Rudder_pedal);
         }
-       if (Throttle_pct_input) {
+       if (pilot_throttle_no) {
             globals->get_controls()->set_throttle(0,Throttle_pct);
             //   controls.set_throttle(0,Throttle_pct);
         }
@@ -616,7 +618,6 @@ void FGLaRCsim::snap_shot(void) {
 void FGLaRCsim::set_Latitude(double lat) {
     SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Latitude: " << lat  );
     snap_shot();
-    _set_Runway_altitude( scenery.get_cur_elev() * SG_METER_TO_FEET );
     lsic->SetLatitudeGDRadIC(lat);
     set_ls();
     copy_from_LaRCsim(); //update the bus
@@ -625,8 +626,6 @@ void FGLaRCsim::set_Latitude(double lat) {
 void FGLaRCsim::set_Longitude(double lon) {
     SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Longitude: " << lon  );
     snap_shot();
-    
-    _set_Runway_altitude( scenery.get_cur_elev() * SG_METER_TO_FEET );
     lsic->SetLongitudeRadIC(lon);
     set_ls();
     copy_from_LaRCsim(); //update the bus
@@ -635,7 +634,6 @@ void FGLaRCsim::set_Longitude(double lon) {
 void FGLaRCsim::set_Altitude(double alt) {
     SG_LOG( SG_FLIGHT, SG_INFO, "FGLaRCsim::set_Altitude: " << alt  );
     snap_shot();
-    _set_Runway_altitude( scenery.get_cur_elev() * SG_METER_TO_FEET );
     lsic->SetAltitudeFtIC(alt);
     set_ls();
     copy_from_LaRCsim(); //update the bus
@@ -714,6 +712,7 @@ void FGLaRCsim::set_AltitudeAGL(double altagl) {
     copy_from_LaRCsim();
 }
 
+/*  getting a namespace conflict...
 void FGLaRCsim::set_Velocities_Local_Airmass (double wnorth, 
                                              double weast, 
                                              double wdown ) {
@@ -724,6 +723,7 @@ void FGLaRCsim::set_Velocities_Local_Airmass (double wnorth,
     set_ls();
     copy_from_LaRCsim();
 }
+*/
 
 void FGLaRCsim::set_Static_pressure(double p) { 
     SG_LOG( SG_FLIGHT, SG_INFO,