mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 21:56:43 +08:00
Ref T259, Ref T243 removed guessing from FSX driver code (now in interpolator) and also use guessing in emulated driver
This commit is contained in:
committed by
Roland Winklmeier
parent
f1faeef84a
commit
5c6a37c669
@@ -1108,18 +1108,20 @@ namespace BlackSimPlugin
|
||||
Q_ASSERT_X(!callsign.isEmpty(), Q_FUNC_INFO, "missing callsign");
|
||||
Q_ASSERT_X(simObject.hasValidRequestAndObjectId(), Q_FUNC_INFO, "Missing ids");
|
||||
|
||||
// fetch parts
|
||||
// setup
|
||||
const CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(callsign);
|
||||
const bool useAircraftParts = setup.isAircraftPartsEnabled() && aircraftWithParts.contains(callsign);
|
||||
const bool logInterpolationAndParts = setup.logInterpolation();
|
||||
const bool sendGround = setup.sendGndFlagToSimulator();
|
||||
CPartsStatus partsStatus(useAircraftParts);
|
||||
const CAircraftParts parts = useAircraftParts ? simObject.getInterpolatedParts(currentTimestamp, setup, partsStatus, logInterpolationAndParts) : CAircraftParts();
|
||||
|
||||
// get interpolated situation
|
||||
// Interpolated situation
|
||||
CInterpolationStatus interpolatorStatus;
|
||||
const CAircraftSituation interpolatedSituation = simObject.getInterpolatedSituation(currentTimestamp, setup, interpolatorStatus);
|
||||
|
||||
// Interpolated parts
|
||||
const CAircraftParts parts = useAircraftParts ? simObject.getInterpolatedOrGuessedParts(currentTimestamp, setup, partsStatus, logInterpolationAndParts) : CAircraftParts::guessedParts(interpolatedSituation, simObject.isVtol(), simObject.getEngineCount());
|
||||
|
||||
if (interpolatorStatus.hasValidSituation())
|
||||
{
|
||||
// update situation
|
||||
@@ -1152,14 +1154,6 @@ namespace BlackSimPlugin
|
||||
{
|
||||
this->updateRemoteAircraftParts(simObject, parts, partsStatus);
|
||||
}
|
||||
else
|
||||
{
|
||||
// guess on position, but not every frame
|
||||
if (m_interpolationRequest % GuessRemoteAircraftPartsCycle == 0)
|
||||
{
|
||||
this->guessAndUpdateRemoteAircraftParts(simObject, interpolatedSituation, interpolatorStatus);
|
||||
}
|
||||
}
|
||||
} // all callsigns
|
||||
|
||||
const qint64 dt = QDateTime::currentMSecsSinceEpoch() - currentTimestamp;
|
||||
@@ -1168,16 +1162,6 @@ namespace BlackSimPlugin
|
||||
m_statsUpdateAircraftTimeAvgMs = m_statsUpdateAircraftTimeTotalMs / m_statsUpdateAircraftCountMs;
|
||||
}
|
||||
|
||||
bool CSimulatorFsxCommon::guessAndUpdateRemoteAircraftParts(const CSimConnectObject &simObj, const CAircraftSituation &interpolatedSituation, const CInterpolationStatus &interpolationStatus)
|
||||
{
|
||||
if (!simObj.hasValidRequestAndObjectId()) { return false; }
|
||||
if (!interpolationStatus.isInterpolated()) { return false; }
|
||||
|
||||
const CAircraftParts parts = CAircraftParts::guessedParts(interpolatedSituation, simObj.isVtol(), 4);
|
||||
DataDefinitionRemoteAircraftPartsWithoutLights ddRemoteAircraftPartsWithoutLights(parts);
|
||||
return this->sendRemoteAircraftPartsToSimulator(simObj, ddRemoteAircraftPartsWithoutLights, parts.getAdjustedLights());
|
||||
}
|
||||
|
||||
bool CSimulatorFsxCommon::updateRemoteAircraftParts(const CSimConnectObject &simObj, const CAircraftParts &parts, const CPartsStatus &partsStatus)
|
||||
{
|
||||
if (!simObj.hasValidRequestAndObjectId()) { return false; }
|
||||
|
||||
Reference in New Issue
Block a user