mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 23:45:35 +08:00
Ref T185 Enable spline interpolation with only one position update,
by just copying it three times, so planes can be rendered without waiting for more updates.
This commit is contained in:
@@ -265,12 +265,26 @@ namespace BlackMisc
|
||||
template <typename Derived>
|
||||
void CInterpolator<Derived>::addAircraftSituation(const CAircraftSituation &situation)
|
||||
{
|
||||
if (m_aircraftSituations.isEmpty())
|
||||
{
|
||||
// make sure we have enough situations to do start interpolating immediately without waiting for more updates
|
||||
m_aircraftSituations = { situation, situation };
|
||||
m_aircraftSituations.back().addMsecs(-10000); // number here does
|
||||
m_aircraftSituations.front().addMsecs(-5000); // not really matter
|
||||
}
|
||||
m_aircraftSituations.push_frontMaxElements(situation, IRemoteAircraftProvider::MaxSituationsPerCallsign);
|
||||
}
|
||||
|
||||
template <typename Derived>
|
||||
void CInterpolator<Derived>::addAircraftParts(const CAircraftParts &parts)
|
||||
{
|
||||
if (m_aircraftParts.isEmpty())
|
||||
{
|
||||
// make sure we have enough parts to do start interpolating immediately without waiting for more updates
|
||||
m_aircraftParts = { parts, parts };
|
||||
m_aircraftParts.back().addMsecs(-10000); // number here does
|
||||
m_aircraftParts.front().addMsecs(-5000); // not really matter
|
||||
}
|
||||
m_aircraftParts.push_front(parts);
|
||||
IRemoteAircraftProvider::removeOutdatedParts(m_aircraftParts);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user