]> git.mxchange.org Git - flightgear.git/blob - src/FDM/YASim/Jet.cpp
001196b53bca8123f14b61d3b57c2217f9fcf745
[flightgear.git] / src / FDM / YASim / Jet.cpp
1 #include "Atmosphere.hpp"
2 #include "Math.hpp"
3 #include "Jet.hpp"
4 namespace yasim {
5
6 Jet::Jet()
7 {
8     _rho0 = Atmosphere::getStdDensity(0);
9     _thrust = 0;
10     _abThrust = 0;
11     _reheat = 0;
12 }
13
14 void Jet::stabilize()
15 {
16     return; // no-op for now
17 }
18
19 void Jet::setDryThrust(float thrust)
20 {
21     _thrust = thrust;
22 }
23
24 void Jet::setReheatThrust(float thrust)
25 {
26     _abThrust = thrust;
27 }
28
29 void Jet::setReheat(float reheat)
30 {
31     _reheat = Math::clamp(reheat, 0, 1);
32 }
33
34 void Jet::getThrust(float* out)
35 {
36     float t = _thrust * _throttle;
37     t += (_abThrust - _thrust) * _reheat;
38     t *= _rho / _rho0;
39     Math::mul3(t, _dir, out);
40 }
41
42 void Jet::getTorque(float* out)
43 {
44     out[0] = out[1] = out[2] = 0;
45     return;
46 }
47
48 void Jet::getGyro(float* out)
49 {
50     out[0] = out[1] = out[2] = 0;
51     return;
52 }
53
54 float Jet::getFuelFlow()
55 {
56     return 0;
57 }
58
59 void Jet::integrate(float dt)
60 {
61     return;
62 }
63
64 }; // namespace yasim