X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FBalloon.cxx;h=211b7c6acf3747d06595175793943bf0062a988f;hb=ae1028b795c3a492844af468b574db8b18e97f98;hp=ec77205b0fcad168039df73e6a898951af8da0d7;hpb=c682dec8983613ae26aa320740cf9ab0869af818;p=flightgear.git diff --git a/src/FDM/Balloon.cxx b/src/FDM/Balloon.cxx index ec77205b0..211b7c6ac 100644 --- a/src/FDM/Balloon.cxx +++ b/src/FDM/Balloon.cxx @@ -37,7 +37,7 @@ HISTORY /* INCLUDES */ /****************************************************************************/ -#include +#include #ifdef FG_MATH_EXCEPTION_CLASH # include @@ -45,13 +45,14 @@ HISTORY #include STL_STRING +#include +#include +#include +#include + #include #include -#include -#include #include
-#include -#include #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 @@ -110,7 +111,7 @@ int FGBalloonSim::update( int multiloop ) { } // set control positions - current_balloon.set_burner_strength ( controls.get_elevator() ); /*controls.get_throttle( 0 )*/ + current_balloon.set_burner_strength ( controls.get_throttle(0) ); //not more implemented yet // Inform BalloonSim of the local terrain altitude @@ -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; }