mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 13:36:48 +08:00
committed by
Klaus Basan
parent
eb58450e8c
commit
ea561cf723
@@ -79,6 +79,7 @@ namespace BlackSimPlugin
|
||||
FS_PBH pbhstrct;
|
||||
pbhstrct.pbh = positionVelocity.pbh;
|
||||
int pitch = pbhstrct.pitch / CFs9Sdk::pitchMultiplier();
|
||||
if (pitch < -90 || pitch > 89) { CLogMessage(nullptr).warning("FS9: Pitch value out of limits: %1") << pitch; }
|
||||
int bank = pbhstrct.bank / CFs9Sdk::bankMultiplier();
|
||||
|
||||
// MSFS has inverted pitch and bank angles
|
||||
|
||||
@@ -357,13 +357,18 @@ namespace BlackSimPlugin
|
||||
position.setGeodeticHeight(groundAltitude);
|
||||
situation.setPosition(position);
|
||||
|
||||
// speeds, situation
|
||||
const double angleCorrectionFactor = 360.0 / 65536.0 / 65536.0; // see FSUIPC docu
|
||||
pitchRaw *= angleCorrectionFactor;
|
||||
bankRaw *= angleCorrectionFactor;
|
||||
|
||||
// MSFS has inverted pitch and bank angles
|
||||
pitchRaw = ~pitchRaw;
|
||||
bankRaw = ~bankRaw;
|
||||
const double angleCorrectionFactor = 360.0 / 65536.0 / 65536.0; // see FSUIPC docu
|
||||
CAngle pitch = CAngle(pitchRaw * angleCorrectionFactor, CAngleUnit::deg());
|
||||
CAngle bank = CAngle(bankRaw * angleCorrectionFactor, CAngleUnit::deg());
|
||||
if (pitchRaw < -90 || pitchRaw > 89) { CLogMessage(this).warning("FSUIPC: Pitch value out of limits: %1") << pitchRaw; }
|
||||
|
||||
// speeds, situation
|
||||
CAngle pitch = CAngle(pitchRaw, CAngleUnit::deg());
|
||||
CAngle bank = CAngle(bankRaw, CAngleUnit::deg());
|
||||
CHeading heading = CHeading(headingRaw * angleCorrectionFactor, CHeading::True, CAngleUnit::deg());
|
||||
CSpeed groundspeed(groundspeedRaw / 65536.0, CSpeedUnit::m_s());
|
||||
CAltitude altitude(altitudeRaw / (65536.0 * 65536.0), CAltitude::MeanSeaLevel, CLengthUnit::m());
|
||||
|
||||
@@ -381,6 +381,10 @@ namespace BlackSimPlugin
|
||||
position.setLatitude(CLatitude(simulatorOwnAircraft.latitude, CAngleUnit::deg()));
|
||||
position.setLongitude(CLongitude(simulatorOwnAircraft.longitude, CAngleUnit::deg()));
|
||||
|
||||
if (simulatorOwnAircraft.pitch < -90.0 || simulatorOwnAircraft.pitch >= 90.0)
|
||||
{
|
||||
CLogMessage(this).warning("FSX: Pitch value out of limits: %1") << simulatorOwnAircraft.pitch;
|
||||
}
|
||||
BlackMisc::Aviation::CAircraftSituation aircraftSituation;
|
||||
aircraftSituation.setPosition(position);
|
||||
// MSFS has inverted pitch and bank angles
|
||||
|
||||
Reference in New Issue
Block a user