Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi!

I've just begun using FSUIPC and I'm having difficulty accessing pitch information from FS. I am able to read the data, just don't know how to get a reasonable value! According to the documentation, the size of pitch is 4, so I have an array of 5 chars. But how do I convert this array into a reasonable double or float value? I don't have a lot of experience with bytes and memory so I'd be grateful if someone could give me a small hint on how to proceed!

Thanks a lot,

Mark

Posted

According to the documentation, the size of pitch is 4, so I have an array of 5 chars. But how do I convert this array into a reasonable double or float value?

Don't read it into an array of characters. The 4 byte length is simply the length of the number -- it is 32 bits (4 x 8 = 32), i.e. a standard Integer. Just read it into an integer. The you can copy it into a double or whatever afterwards and perform the conversion to degrees.

Pete

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.