refactor: Move OnGround information to own class

This commit is contained in:
Lars Toenning
2024-01-08 22:53:45 +01:00
parent 8b44d3fd4e
commit a27c2b3f51
27 changed files with 452 additions and 366 deletions

View File

@@ -84,21 +84,20 @@ namespace BlackMisc::Simulation
if (interpolateGndFactor)
{
const double startGroundFactor = m_startSituation.getOnGroundFactor();
const double endGroundFactor = m_endSituation.getOnGroundFactor();
const double startGroundFactor = m_startSituation.getOnGroundInfo().getGroundFactor();
const double endGroundFactor = m_endSituation.getOnGroundInfo().getGroundFactor();
if (CAircraftSituation::isGfEqualAirborne(startGroundFactor, endGroundFactor))
{
interpolatedSituation.setOnGround(false);
interpolatedSituation.setOnGroundInfo({ COnGroundInfo::NotOnGround, COnGroundInfo::OnGroundByInterpolation });
}
else if (CAircraftSituation::isGfEqualOnGround(startGroundFactor, endGroundFactor))
{
interpolatedSituation.setOnGround(true);
interpolatedSituation.setOnGroundInfo({ COnGroundInfo::OnGround, COnGroundInfo::OnGroundByInterpolation });
}
else
{
const double interpolatedGroundFactor = (endGroundFactor - startGroundFactor) * tf + startGroundFactor;
interpolatedSituation.setOnGroundFactor(interpolatedGroundFactor);
interpolatedSituation.setOnGroundFromGroundFactorFromInterpolation(groundInterpolationFactor());
interpolatedSituation.setOnGroundInfo(COnGroundInfo(interpolatedGroundFactor));
}
}
return interpolatedSituation;