2
#include "Thruster.hpp"
7
_dir[0] = 1; _dir[1] = 0; _dir[2] = 0;
9
for(i=0; i<3; i++) _pos[i] = _wind[i] = 0;
12
_pressure = _temp = _rho = 0;
19
void Thruster::getPosition(float* out)
22
for(i=0; i<3; i++) out[i] = _pos[i];
25
void Thruster::setPosition(float* pos)
28
for(i=0; i<3; i++) _pos[i] = pos[i];
31
void Thruster::getDirection(float* out)
34
for(i=0; i<3; i++) out[i] = _dir[i];
37
void Thruster::setDirection(float* dir)
39
Math::unit3(dir, _dir);
42
void Thruster::setThrottle(float throttle)
44
_throttle = Math::clamp(throttle, 0, 1);
47
void Thruster::setMixture(float mixture)
49
_mixture = Math::clamp(mixture, 0, 1);
52
void Thruster::setWind(float* wind)
55
for(i=0; i<3; i++) _wind[i] = wind[i];
58
void Thruster::setAir(float pressure, float temp)
62
_rho = _pressure / (287.1 * _temp);