2001-12-01 06:22:24 +00:00
|
|
|
#include "Atmosphere.hpp"
|
|
|
|
#include "Math.hpp"
|
|
|
|
#include "Jet.hpp"
|
|
|
|
namespace yasim {
|
|
|
|
|
|
|
|
Jet::Jet()
|
|
|
|
{
|
|
|
|
_rho0 = Atmosphere::getStdDensity(0);
|
|
|
|
_thrust = 0;
|
2001-12-06 18:13:24 +00:00
|
|
|
_abThrust = 0;
|
2001-12-01 06:22:24 +00:00
|
|
|
_reheat = 0;
|
|
|
|
}
|
|
|
|
|
2001-12-06 18:13:24 +00:00
|
|
|
void Jet::stabilize()
|
2001-12-01 06:22:24 +00:00
|
|
|
{
|
2001-12-06 18:13:24 +00:00
|
|
|
return; // no-op for now
|
2001-12-01 06:22:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Jet::setDryThrust(float thrust)
|
|
|
|
{
|
|
|
|
_thrust = thrust;
|
|
|
|
}
|
|
|
|
|
2001-12-06 18:13:24 +00:00
|
|
|
void Jet::setReheatThrust(float thrust)
|
|
|
|
{
|
|
|
|
_abThrust = thrust;
|
|
|
|
}
|
|
|
|
|
2001-12-01 06:22:24 +00:00
|
|
|
void Jet::setReheat(float reheat)
|
|
|
|
{
|
2001-12-06 18:13:24 +00:00
|
|
|
_reheat = Math::clamp(reheat, 0, 1);
|
2001-12-01 06:22:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void Jet::getThrust(float* out)
|
|
|
|
{
|
2001-12-06 18:13:24 +00:00
|
|
|
float t = _thrust * _throttle;
|
|
|
|
t += (_abThrust - _thrust) * _reheat;
|
|
|
|
t *= _rho / _rho0;
|
2001-12-01 06:22:24 +00:00
|
|
|
Math::mul3(t, _dir, out);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Jet::getTorque(float* out)
|
|
|
|
{
|
|
|
|
out[0] = out[1] = out[2] = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Jet::getGyro(float* out)
|
|
|
|
{
|
|
|
|
out[0] = out[1] = out[2] = 0;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
float Jet::getFuelFlow()
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void Jet::integrate(float dt)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
}; // namespace yasim
|