]> git.mxchange.org Git - flightgear.git/blob - src/FDM/YASim/Thruster.hpp
Initial revision of Andy Ross's YASim code. This is (Y)et (A)nother Flight
[flightgear.git] / src / FDM / YASim / Thruster.hpp
1 #ifndef _THRUSTER_HPP
2 #define _THRUSTER_HPP
3
4 namespace yasim {
5
6 class Thruster {
7 public:
8     Thruster();
9     virtual ~Thruster();
10
11     // Static data
12     void getPosition(float* out);
13     void setPosition(float* pos);
14     void getDirection(float* out);
15     void setDirection(float* dir);
16
17     virtual Thruster* clone()=0;
18
19     // Controls
20     void setThrottle(float throttle);
21     void setMixture(float mixture);
22     void setPropAdvance(float advance);
23
24     // Dynamic output
25     virtual void getThrust(float* out)=0;
26     virtual void getTorque(float* out)=0;
27     virtual void getGyro(float* out)=0;
28     virtual float getFuelFlow()=0;
29
30     // Runtime instructions
31     void setWind(float* wind);
32     void setDensity(float rho);
33     virtual void integrate(float dt)=0;
34
35 protected:
36     void cloneInto(Thruster* out);
37
38     float _pos[3];
39     float _dir[3];
40     float _throttle;
41     float _mixture;
42     float _propAdvance;
43
44     float _wind[3];
45     float _rho;
46 };
47
48 }; // namespace yasim
49 #endif // _THRUSTER_HPP
50