now that there is a true track property, the magnetic track is nice to have, too.
This commit is contained in:
parent
690395354f
commit
78d8e7edfd
1 changed files with 14 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue