1 /*****************************************************************************
4 Author: Christian Mayer
7 -------- Copyright (C) 1999 Christian Mayer (fgfs@christianmayer.de) --------
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free Software
11 Foundation; either version 2 of the License, or (at your option) any later
14 This program is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 Further information about the GNU General Public License can also be found on
24 the world wide web at http://www.gnu.org.
26 FUNCTIONAL DESCRIPTION
27 ------------------------------------------------------------------------------
28 Header for the hot air balloon simulator
31 ------------------------------------------------------------------------------
32 01.09.1999 Christian Mayer Created
33 03.10.1999 Christian Mayer cleaned the code by moveing WeatherDatabase
34 calls inside the update()
35 *****************************************************************************/
37 /****************************************************************************/
39 /****************************************************************************/
43 /****************************************************************************/
45 /****************************************************************************/
46 #include <simgear/math/SGMath.hxx>
48 /****************************************************************************/
50 /****************************************************************************/
52 /****************************************************************************/
53 /* CLASS DECLARATION */
54 /****************************************************************************/
60 SGVec3f gravity_vector; //in m/s*s
61 SGVec3f hpr; //the balloon isn't allways exactly vertical (e.g. during gusts); normalized
62 SGVec3f velocity; //current velocity; it gets iterated at each 'update'
63 SGVec3f position; //current position in lat/lon/alt
65 float balloon_envelope_area; //area of the envelope
66 float balloon_envelope_volume; //volume of the envelope
68 float wind_facing_area_of_balloon;
69 float wind_facing_area_of_basket;
71 float cw_envelope; //wind resistance of the envelope
72 float cw_basket; //wind resistance of the bakset
75 float weight_of_total_fuel;
76 float weight_of_envelope;
77 float weight_of_basket; //weight of all the unmovable stuff such as the basket, the burner and the empty tanks
78 float weight_of_cargo; //passengers and anything left (e.g. sand bags that are thrown away to give additional lift)
80 float fuel_left; //as a percentage
81 float max_flow_of_fuel_per_second; //in percent per second
82 float current_burner_strength;
84 float lambda; //waermeuebergangskoeffizient (heat transmission coefficent?!?) for the envelope
85 float l_of_the_envelope; //the thickness of the envelope (in m)
87 float T; //tempereature inside the balloon
92 balloon(); //constructor for initializing the balloon
94 void update(); //dt = time in seconds since last call
95 void set_burner_strength(const float bs);
97 void getVelocity(SGVec3f& v) const;
98 void setVelocity(const SGVec3f& v);
100 void getPosition(SGVec3f& v) const;
101 void setPosition(const SGVec3f& v);
103 void getHPR(SGVec3f& angles) const; //the balloon isn't allways exactly vertical
104 void setHPR(const SGVec3f& angles); //the balloon isn't allways exactly vertical
106 void setGroundLevel(const float altitude);
108 float getTemperature(void) const;
109 float getFuelLeft(void) const;
111 void set_dt(const float new_dt) { dt = new_dt; }
114 /****************************************************************************/
115 #endif /*BalloonSim_H*/