2 #include "Thruster.hpp"
7 _dir[0] = 1; _dir[1] = 0; _dir[2] = 0;
8 for(int i=0; i<3; i++) _pos[i] = _wind[i] = 0;
18 void Thruster::getPosition(float* out)
20 for(int i=0; i<3; i++) out[i] = _pos[i];
23 void Thruster::setPosition(float* pos)
25 for(int i=0; i<3; i++) _pos[i] = pos[i];
28 void Thruster::getDirection(float* out)
30 for(int i=0; i<3; i++) out[i] = _dir[i];
33 void Thruster::setDirection(float* dir)
35 Math::unit3(dir, _dir);
38 void Thruster::setThrottle(float throttle)
40 _throttle = Math::clamp(throttle, 0, 1);
43 void Thruster::setMixture(float mixture)
45 _mixture = Math::clamp(mixture, 0, 1);
48 void Thruster::setWind(float* wind)
50 for(int i=0; i<3; i++) _wind[i] = wind[i];
53 void Thruster::setAir(float pressure, float temp)
57 _rho = _P / (287.1 * _T);