]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/Balloon.cxx
Added #include <math.h> for fabs()
[flightgear.git] / src / FDM / Balloon.cxx
index 85331bb6398937cb01919a54520ae105896a203f..211b7c6acf3747d06595175793943bf0062a988f 100644 (file)
@@ -37,7 +37,7 @@ HISTORY
 /* INCLUDES                                                                */
 /****************************************************************************/
 
-#include <Include/compiler.h>
+#include <simgear/compiler.h>
 
 #ifdef FG_MATH_EXCEPTION_CLASH
 #  include <math.h>
@@ -45,13 +45,14 @@ HISTORY
 
 #include STL_STRING
 
+#include <simgear/constants.h>
+#include <simgear/debug/logstream.hxx>
+#include <simgear/math/sg_geodesy.hxx>
+#include <simgear/misc/fgpath.hxx>
+
 #include <Aircraft/aircraft.hxx>
 #include <Controls/controls.hxx>
-#include <Debug/logstream.hxx>
-#include <Include/fg_constants.h>
 #include <Main/options.hxx>
-#include <Math/fg_geodesy.hxx>
-#include <Misc/fgpath.hxx>
 
 #include "Balloon.h"
 
@@ -62,7 +63,7 @@ HISTORY
 
 // Initialize the BalloonSim flight model, dt is the time increment for
 // each subsequent iteration through the EOM
-int FGBalloonSim::init( double dt ) {
+bool FGBalloonSim::init( double dt ) {
     sgVec3 temp;
 
     FG_LOG( FG_FLIGHT, FG_INFO, "Starting initializing BalloonSim" );
@@ -95,12 +96,12 @@ int FGBalloonSim::init( double dt ) {
 
     FG_LOG( FG_FLIGHT, FG_INFO, "Finished initializing BalloonSim" );
 
-    return 1;
+    return true;
 }
 
 
 // Run an iteration of the EOM (equations of motion)
-int FGBalloonSim::update( int multiloop ) {
+bool FGBalloonSim::update( int multiloop ) {
     double save_alt = 0.0;
 
     // lets try to avoid really screwing up the BalloonSim model
@@ -150,18 +151,18 @@ int FGBalloonSim::update( int multiloop ) {
        set_Altitude( save_alt );
     }
 
-    return 1;
+    return true;
 }
 
 
 // Convert from the FGInterface struct to the BalloonSim
-int FGBalloonSim::copy_to_BalloonSim() {
-    return 1;
+bool FGBalloonSim::copy_to_BalloonSim() {
+    return true;
 }
 
 
 // Convert from the BalloonSim to the FGInterface struct
-int FGBalloonSim::copy_from_BalloonSim() {
+bool FGBalloonSim::copy_from_BalloonSim() {
 
     sgVec3 temp;
 
@@ -180,9 +181,9 @@ int FGBalloonSim::copy_from_BalloonSim() {
     double alt     = temp[2] * METER_TO_FEET;
 
     double lat_geod, tmp_alt, sl_radius1, sl_radius2, tmp_lat_geoc;
-    fgGeocToGeod( lat_geoc, EQUATORIAL_RADIUS_M + alt * FEET_TO_METER,
+    sgGeocToGeod( lat_geoc, EQUATORIAL_RADIUS_M + alt * FEET_TO_METER,
                  &lat_geod, &tmp_alt, &sl_radius1 );
-    fgGeodToGeoc( lat_geod, alt * FEET_TO_METER, &sl_radius2, &tmp_lat_geoc );
+    sgGeodToGeoc( lat_geod, alt * FEET_TO_METER, &sl_radius2, &tmp_lat_geoc );
 
     FG_LOG( FG_FLIGHT, FG_DEBUG, "lon = " << lon << " lat_geod = " << lat_geod
            << " lat_geoc = " << lat_geoc
@@ -197,7 +198,7 @@ int FGBalloonSim::copy_from_BalloonSim() {
 
     current_balloon.getHPR( temp );
     set_Euler_Angles( temp[0], temp[1], temp[2] );
-
+    set_Euler_Rates(0,0,0);
 
     set_Alpha( 0.0/*FDMExec.GetTranslation()->Getalpha()*/ );
     set_Beta( 0.0/*FDMExec.GetTranslation()->Getbeta()*/ );
@@ -212,7 +213,7 @@ int FGBalloonSim::copy_from_BalloonSim() {
     set_sin_cos_longitude( lon );
     set_sin_cos_latitude( lat_geod );
 
-    return 0;
+    return true;
 }