When dealing with pitch and bank as signed ints, it is desirable to

round down, rather than toward zero, to get a linear distribution.

refs #790
This commit is contained in:
Mathew Sutcliffe
2016-11-06 19:25:39 +00:00
committed by Klaus Basan
parent f4d7474941
commit b5dfd15d66
3 changed files with 8 additions and 8 deletions

View File

@@ -78,9 +78,9 @@ namespace BlackSimPlugin
FS_PBH pbhstrct;
pbhstrct.pbh = positionVelocity.pbh;
int pitch = pbhstrct.pitch / CFs9Sdk::pitchMultiplier();
int pitch = std::floor(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 = std::floor(pbhstrct.bank / CFs9Sdk::bankMultiplier());
// MSFS has inverted pitch and bank angles
pitch = ~pitch;