Reflecting discussed changes for interpolation performance refs #386

(based on FSX testing)
* Only send changed situation to SIM
* Split sending of parts / situations
* Only send parts with a reduced frequency (means slower as positions)
* Mark geodetic height as null for default values (the value is usually unavailable)
* Fixed altitude to MSL for network data
* Trace which aircrafts support aircraft parts via network
* Renamed insert_fron push_front (as proposed by Roland)

Status quo / lessons learnt
* On slower PCs jitter is still noticed for interpolated aircraft.
* Running interpolation in an independent process (aka core, not in GUI) reduced load dependencies
  => it seems to make sense to run driver in own thread
* The onGround flag in parts seems clumsy as it required to retrieve parts for position updates
* In interpolation performance really matters
This commit is contained in:
Klaus Basan
2015-02-26 21:47:28 +01:00
parent ca6cd9c063
commit eca8c5b637
21 changed files with 376 additions and 320 deletions

View File

@@ -81,31 +81,14 @@ namespace BlackSimPlugin
if (m_clientStatus == Disconnected) { return; }
bool ok;
CAircraftSituation situation = this->m_interpolator->getCurrentInterpolatedSituation(this->m_interpolator->getSituationsByCallsign(), m_callsign, -1, &ok);
if (!ok) { return; }
MPPositionSlewMode positionSlewMode = aircraftSituationToFS9(situation);
IInterpolator::InterpolationStatus status;
CAircraftSituation situation = this->m_interpolator->getInterpolatedSituation(m_callsign, -1, status);
QByteArray positionMessage;
MultiPlayerPacketParser::writeType(positionMessage, CFs9Sdk::MULTIPLAYER_PACKET_ID_POSITION_SLEWMODE);
MultiPlayerPacketParser::writeSize(positionMessage, positionSlewMode.size());
positionSlewMode.packet_index = m_packetIndex;
++m_packetIndex;
positionMessage = MultiPlayerPacketParser::writeMessage(positionMessage, positionSlewMode);
sendMessage(positionMessage);
QByteArray paramMessage;
MPParam param;
MultiPlayerPacketParser::writeType(paramMessage, CFs9Sdk::MULTIPLAYER_PACKET_ID_PARAMS);
MultiPlayerPacketParser::writeSize(paramMessage, param.size());
param.packet_index = m_packetIndex;
++m_packetIndex;
paramMessage = MultiPlayerPacketParser::writeMessage(paramMessage, param);
sendMessage(paramMessage);
m_lastAircraftSituation = situation;
// Test only for successful interpolation. FS9 requires constant positions
if (!status.interpolationSucceeded) return;
sendMultiplayerPosition(situation);
sendMultiplayerParamaters();
}
void CFs9Client::initialize()