1
0
Fork 0

YASim backward compatibility fix for ground effect calculation (added if isVersionOrNewer).

This commit is contained in:
Henning Stahlke 2017-03-16 09:39:58 +01:00
parent 1c932b3d79
commit bb9a8a1850

View file

@ -657,6 +657,14 @@ void Airplane::compile()
float gespan = 0; float gespan = 0;
gespan = _wing->getSpan(); gespan = _wing->getSpan();
_wing->getBase(gepos); _wing->getBase(gepos);
if(!isVersionOrNewer( Version::YASIM_VERSION_2017_2 )) {
//old code
//float span = _length * Math::cos(_sweep) * Math::cos(_dihedral);
//span = 2*(span + Math::abs(_base[2]));
gespan -= 2*gepos[1]; // cut away base (y-distance)
gespan += 2*Math::abs(gepos[2]); // add (wrong) z-distance
}
baseN->getChild("wing", 0)->getNode("gnd-eff-span", true)->setFloatValue(gespan);
// where does the hard coded factor 0.15 come from? // where does the hard coded factor 0.15 come from?
_model.setGroundEffect(gepos, gespan, 0.15f); _model.setGroundEffect(gepos, gespan, 0.15f);
} }