1
0
Fork 0

YASim: add setAirFromStandardAtmosphere() to Class Model.

This commit is contained in:
Henning Stahlke 2017-04-07 23:15:39 +02:00
parent 7f5a91ea47
commit 574f2f907f
3 changed files with 10 additions and 6 deletions

View file

@ -210,6 +210,13 @@ void Model::setAir(const float pressure, const float temp, const float density)
_rho = density; _rho = density;
} }
void Model::setAirFromStandardAtmosphere(const float altitude)
{
_pressure = Atmosphere::getStdPressure(altitude);
_temp = Atmosphere::getStdTemperature(altitude);
_rho = Atmosphere::getStdDensity(altitude);
}
void Model::updateGround(State* s) void Model::updateGround(State* s)
{ {
float dummy[3]; float dummy[3];

View file

@ -70,6 +70,7 @@ public:
void setGroundEffect(const float* pos, const float span, const float mul); void setGroundEffect(const float* pos, const float span, const float mul);
void setWind(float* wind) { Math::set3(wind, _wind); } void setWind(float* wind) { Math::set3(wind, _wind); }
void setAir(const float pressure, const float temp, const float density); void setAir(const float pressure, const float temp, const float density);
void setAirFromStandardAtmosphere(const float altitude);
void updateGround(State* s); void updateGround(State* s);

View file

@ -54,9 +54,7 @@ void yasim_graph(Airplane* a, const float alt, const float kts, int cfg = CONFIG
Model* m = a->getModel(); Model* m = a->getModel();
State s; State s;
m->setAir(Atmosphere::getStdPressure(alt), m->setAirFromStandardAtmosphere(alt);
Atmosphere::getStdTemperature(alt),
Atmosphere::getStdDensity(alt));
switch (cfg) { switch (cfg) {
case CONFIG_APPROACH: case CONFIG_APPROACH:
@ -131,9 +129,7 @@ void yasim_drag(Airplane* a, const float aoa, const float alt, int cfg = CONFIG_
Model* m = a->getModel(); Model* m = a->getModel();
State s; State s;
m->setAir(Atmosphere::getStdPressure(alt), m->setAirFromStandardAtmosphere(alt);
Atmosphere::getStdTemperature(alt),
Atmosphere::getStdDensity(alt));
switch (cfg) { switch (cfg) {
case CONFIG_APPROACH: case CONFIG_APPROACH: