FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
- You should have received a copy of the GNU General Public License along with
- this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- Place - Suite 330, Boston, MA 02111-1307, USA.
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Further information about the GNU General Public License can also be found on
the world wide web at http://www.gnu.org.
/* INCLUDES */
/****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <simgear/compiler.h>
#ifdef SG_MATH_EXCEPTION_CLASH
#include <simgear/misc/sg_path.hxx>
#include <Aircraft/aircraft.hxx>
-#include <Controls/controls.hxx>
#include <Main/globals.hxx>
#include <Main/fg_props.hxx>
// Initialize the BalloonSim flight model, dt is the time increment for
// each subsequent iteration through the EOM
void FGBalloonSim::init() {
- // explicitly call the superclass's
- // init method first.
- FGInterface::init();
+
+ //do init common to all the FDM's
+ common_init();
+
+ //now do init specific to the Balloon
sgVec3 temp;
//set velocities
sgSetVec3( temp,
- fgGetDouble("/velocities/uBody-fps"),
- fgGetDouble("/velocities/vBody-fps"),
- fgGetDouble("/velocities/wBody-fps") );
+ fgGetDouble("/sim/presets/uBody-fps"),
+ fgGetDouble("/sim/presets/vBody-fps"),
+ fgGetDouble("/sim/presets/wBody-fps") );
current_balloon.setVelocity( temp );
SG_LOG( SG_FLIGHT, SG_INFO, "Finished initializing BalloonSim" );
// Run an iteration of the EOM (equations of motion)
-bool FGBalloonSim::update( int multiloop ) {
+void FGBalloonSim::update( double dt ) {
double save_alt = 0.0;
+ if (is_suspended())
+ return;
+
+ int multiloop = _calc_multiloop(dt);
+
// lets try to avoid really screwing up the BalloonSim model
if ( get_Altitude() < -9000 ) {
save_alt = get_Altitude();
if ( save_alt < -9000.0 ) {
set_Altitude( save_alt );
}
-
- return true;
}
//temp[1]: longitude
//temp[2]: altitude (meters)
- _updatePosition( temp[0], temp[1], temp[2] * SG_METER_TO_FEET );
+ _updateGeocentricPosition( temp[0], temp[1], temp[2] * SG_METER_TO_FEET );
current_balloon.getHPR( temp );
set_Euler_Angles( temp[0], temp[1], temp[2] );