]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/MagicCarpet.cxx
Add a link library needed by Irix.
[flightgear.git] / src / FDM / MagicCarpet.cxx
index 46816061f0d9663148025c3ab679b1faa41e2b3b..858ff522139447b0aa5e1a1735405467f6d3d0bd 100644 (file)
@@ -44,6 +44,9 @@ 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();
 }
 
 
@@ -56,7 +59,7 @@ bool FGMagicCarpet::update( int multiloop ) {
     // speed and distance traveled
     double speed = controls.get_throttle( 0 ) * 2000; // meters/sec
     double dist = speed * time_step;
-    double kts = speed * METER_TO_NM * 3600.0;
+    double kts = speed * SG_METER_TO_NM * 3600.0;
     _set_V_equiv_kts( kts );
     _set_V_calibrated_kts( kts );
     _set_V_ground_speed( kts );
@@ -74,17 +77,17 @@ bool FGMagicCarpet::update( int multiloop ) {
     double lat2, lon2, az2;
     if ( speed > SG_EPSILON ) {
        geo_direct_wgs_84 ( get_Altitude(),
-                           get_Latitude() * RAD_TO_DEG,
-                           get_Longitude() * RAD_TO_DEG,
-                           get_Psi() * RAD_TO_DEG,
+                           get_Latitude() * SGD_RADIANS_TO_DEGREES,
+                           get_Longitude() * SGD_RADIANS_TO_DEGREES,
+                           get_Psi() * SGD_RADIANS_TO_DEGREES,
                            dist, &lat2, &lon2, &az2 );
 
-       _set_Longitude( lon2 * DEG_TO_RAD );
-       _set_Latitude( lat2 * DEG_TO_RAD );
+       _set_Longitude( lon2 * SGD_DEGREES_TO_RADIANS );
+       _set_Latitude( lat2 * SGD_DEGREES_TO_RADIANS );
     }
 
-    // cout << "lon error = " << fabs(end.x()*RAD_TO_DEG - lon2)
-    //      << "  lat error = " << fabs(end.y()*RAD_TO_DEG - lat2)
+    // cout << "lon error = " << fabs(end.x()*SGD_RADIANS_TO_DEGREES - lon2)
+    //      << "  lat error = " << fabs(end.y()*SGD_RADIANS_TO_DEGREES - lat2)
     //      << endl;
 
     double sl_radius, lat_geoc;
@@ -99,7 +102,7 @@ bool FGMagicCarpet::update( int multiloop ) {
                             sl_radius + get_Altitude() + climb );
     // cout << "sea level radius (ft) = " << sl_radius << endl;
     // cout << "(setto) sea level radius (ft) = " << get_Sea_level_radius() << endl;
-    _set_Sea_level_radius( sl_radius * METER_TO_FEET);
+    _set_Sea_level_radius( sl_radius * SG_METER_TO_FEET);
     _set_Altitude( get_Altitude() + climb );
 
     return true;