1
0
Fork 0

now that there is a true track property, the magnetic track is nice to have, too.

This commit is contained in:
torsten 2010-01-03 09:49:28 +00:00 committed by Tim Moore
parent 690395354f
commit 78d8e7edfd

View file

@ -349,6 +349,18 @@ getHeadingMag ()
return magheading;
}
/**
* Return the current track in degrees.
*/
static double
getTrackMag ()
{
double magtrack;
magtrack = current_aircraft.fdm_state->get_Track() - getMagVar();
if (magtrack < 0) magtrack += 360;
return magtrack;
}
static long
getWarp ()
{
@ -508,6 +520,7 @@ FGProperties::bind ()
// Orientation
fgTie("/orientation/heading-magnetic-deg", getHeadingMag);
fgTie("/orientation/track-magnetic-deg", getTrackMag);
fgTie("/environment/magnetic-variation-deg", getMagVar);
fgTie("/environment/magnetic-dip-deg", getMagDip);
@ -537,6 +550,7 @@ FGProperties::unbind ()
// Orientation
fgUntie("/orientation/heading-magnetic-deg");
fgUntie("/orientation/track-magnetic-deg");
// Environment
fgUntie("/environment/magnetic-variation-deg");