mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-04 08:36:52 +08:00
Fix wrong pitch and bank value interpolation
Pitch and bank angle in CAircraftSituation are according to the common aeronautical convention: * Bank in degrees, positive = roll right * Pitch in degrees, positive = pitch up Microsoft Flight Simulator is using inverted angles, which was incorrectly adjusted in the interpolator. This caused wrong values for X-Plane. This angle correction is now moved into the MSFS specific plugins. Additionally, so far the pitch and bank angles from own aircraft were not yet corrected for MSFS. So we did send wrong values to the network. refs #790
This commit is contained in:
committed by
Klaus Basan
parent
44fcba296b
commit
42737faf2c
@@ -161,20 +161,12 @@ namespace BlackMisc
|
||||
CAngle pitchBegin = oldSituation.getPitch();
|
||||
CAngle pitchEnd = newSituation.getPitch();
|
||||
CAngle pitch = (pitchEnd - pitchBegin) * simulationTimeFraction + pitchBegin;
|
||||
|
||||
// TODO: According to the specification, pitch above horizon should be negative.
|
||||
// But somehow we get positive pitches from the network.
|
||||
pitch *= -1;
|
||||
currentSituation.setPitch(pitch);
|
||||
|
||||
// Interpolate bank: Bank = (BankB - BankA) * t + BankA
|
||||
CAngle bankBegin = oldSituation.getBank();
|
||||
CAngle bankEnd = newSituation.getBank();
|
||||
CAngle bank = (bankEnd - bankBegin) * simulationTimeFraction + bankBegin;
|
||||
|
||||
// TODO: According to the specification, banks to the right should be negative.
|
||||
// But somehow we get positive banks from the network.
|
||||
bank *= -1.0;
|
||||
currentSituation.setBank(bank);
|
||||
|
||||
currentSituation.setGroundSpeed((newSituation.getGroundSpeed() - oldSituation.getGroundSpeed())
|
||||
|
||||
Reference in New Issue
Block a user