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