Sign in to follow this  
Guest pscarratt

More C Help

Recommended Posts

Hi all,Working through the SDK at the moment trying to get to grips with this C business....When you look at the code below which is trying to work out the compass value, I can't understand where the code is accessing the FS compass variable?Can anyone explain it to me?FLOAT64 FSAPI compass_moving_card_x_cb( PELEMENT_MOVING_IMAGE pelement ){ FLOAT64 val = 360.0 - pelement->source_var_x.var_value.n; if( val >= 0 && val <= 360 ) return val; else return 0;}Many thanks,Paul.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

The function wiskey_moving_card_x_cb() gets the variable from pelement->source_var_x.var_value.n. source_var_x is the first of the two MODULE_VARs defined in the MAKE_MOVING macro called a few lines further down:WHISKEY_COMPASS_DEGREES, wiskey_moving_card_x_cbHope that helps

Share this post


Link to post
Share on other sites

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
Sign in to follow this