sirbenson Posted January 18, 2018 Report Posted January 18, 2018 (edited) Hey everybody, i'm working with the fsuipcclient 3.0 in my c# project. I've some problems with two offsets (pitch and bank). I get the wrong values from fsuipc. i tested it syncron with simconnect. The values from simconnect are correct, fsuipc send wrong values (i think or i made a mistake). I found some solutions in this forum but it doesnt work for me. Here my code: Offsets: private static readonly Offset<double> AirplanePitch = new Offset<double>(0x0578); private static readonly Offset<double> AirplaneBank = new Offset<double>(0x057C); And receive the data: internal static void GetPitchRoll() { MyAircraft.Pitch = AirplanePitch.Value * 360.0 / (65536.0 * 65536.0); MyAircraft.Roll = AirplaneRoll.Value * 360.0 / (65536.0 * 65536.0); } I've got only values between -1.5 deg and + 1.5 deg. Simconnect send me the correct values from -50deg and + 50deg. Is my calculation wrong? I've tested it with other types (float, int, long) but the same :( Edited January 18, 2018 by sirbenson
Paul Henty Posted January 18, 2018 Report Posted January 18, 2018 These offsets are 4-byte integers so should be declared as 'int' Offset<int> playerPitch = new Offset<int>(0x0578); Offset<int> playerBank = new Offset<int>(0x057C); Here's the conversion that I use in the DLL to calculate the pitch/roll in degrees. This works fine. snapshot.PitchDegrees = ((double)playerPitch.Value * 360d) / (65536d * 65536d); snapshot.BankDegrees = ((double)playerBank.Value * 360d) / (65536d * 65536d); Paul
sirbenson Posted January 18, 2018 Author Report Posted January 18, 2018 Wow thank you Paul, it works!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now