]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/MagicCarpet.cxx
First commit of properties code. JSBSim now has a basic property tree all
[flightgear.git] / src / FDM / MagicCarpet.cxx
index 858ff522139447b0aa5e1a1735405467f6d3d0bd..58bf6ec31990f815a3483f116e0ef4cd537abc51 100644 (file)
@@ -44,20 +44,18 @@ FGMagicCarpet::~FGMagicCarpet() {
 // Initialize the Magic Carpet flight model, dt is the time increment
 // for each subsequent iteration through the EOM
 void FGMagicCarpet::init() {
-                               // explicitly call the superclass's
-                               // init method first
-    FGInterface::init();
+    common_init();
 }
 
 
 // Run an iteration of the EOM (equations of motion)
-bool FGMagicCarpet::update( int multiloop ) {
+void FGMagicCarpet::update( int multiloop ) {
     // cout << "FGLaRCsim::update()" << endl;
 
     double time_step = get_delta_t() * multiloop;
 
     // speed and distance traveled
-    double speed = controls.get_throttle( 0 ) * 2000; // meters/sec
+    double speed = globals->get_controls()->get_throttle( 0 ) * 2000; // meters/sec
     double dist = speed * time_step;
     double kts = speed * SG_METER_TO_NM * 3600.0;
     _set_V_equiv_kts( kts );
@@ -65,7 +63,7 @@ bool FGMagicCarpet::update( int multiloop ) {
     _set_V_ground_speed( kts );
 
     // angle of turn
-    double turn_rate = controls.get_aileron() * SGD_PI_4; // radians/sec
+    double turn_rate = globals->get_controls()->get_aileron() * SGD_PI_4; // radians/sec
     double turn = turn_rate * time_step;
 
     // update euler angles
@@ -94,7 +92,7 @@ bool FGMagicCarpet::update( int multiloop ) {
     sgGeodToGeoc( get_Latitude(), get_Altitude(), &sl_radius, &lat_geoc );
 
     // update altitude
-    double real_climb_rate = -controls.get_elevator() * 5000; // feet/sec
+    double real_climb_rate = -globals->get_controls()->get_elevator() * 5000; // feet/sec
     _set_Climb_Rate( real_climb_rate / 500.0 );
     double climb = real_climb_rate * time_step;
 
@@ -104,6 +102,4 @@ bool FGMagicCarpet::update( int multiloop ) {
     // cout << "(setto) sea level radius (ft) = " << get_Sea_level_radius() << endl;
     _set_Sea_level_radius( sl_radius * SG_METER_TO_FEET);
     _set_Altitude( get_Altitude() + climb );
-
-    return true;
 }