C++ Tips: Difference between revisions

Jump to navigation Jump to search
258 bytes added ,  7 October 2009
Line 22: Line 22:


* Magnetic vs true headings, bearings and courses - watch out for whether any bearing values are true or magnetic. Most user-facing properties are magnetic, since that's what is used in charts, runway headings, etc. Internal computations (<tt>SGGeodesy::direct</tt>, etc) work in true bearings, so conversion is required. The magvar code computes magnetic variation for you, but also note the variation depends on position - if you read the variation from the property tree, you're getting the value at the user's latitude / longitude.
* Magnetic vs true headings, bearings and courses - watch out for whether any bearing values are true or magnetic. Most user-facing properties are magnetic, since that's what is used in charts, runway headings, etc. Internal computations (<tt>SGGeodesy::direct</tt>, etc) work in true bearings, so conversion is required. The magvar code computes magnetic variation for you, but also note the variation depends on position - if you read the variation from the property tree, you're getting the value at the user's latitude / longitude.
* When the simulation is paused, <tt>SGSubsystem::update</tt> is still called, but with <tt>dt</tt> = 0. This can easily lead to divide-by-zero errors in code; check for it explicitly if working on subsystem code that is doing time-dependency calculations.
580

edits

Navigation menu