1
0
Fork 0

Make PLAN mode in Boeing NDs possible.

Allow the location of the ND centre to be set from properties instead of always using the acct position.
(I thought I'd supported this option long ago, evidently not)
This commit is contained in:
James Turner 2012-12-24 17:42:23 +00:00
parent 41481967f1
commit a6dc2beb4d
2 changed files with 12 additions and 3 deletions

View file

@ -562,6 +562,10 @@ NavDisplay::init ()
_testModeNode->setBoolValue(false);
_viewHeadingNode = _Instrument->getChild("view-heading-deg", 0, true);
_userLatNode = _Instrument->getChild("user-latitude-deg", 0, true);
_userLonNode = _Instrument->getChild("user-longitude-deg", 0, true);
_userPositionEnable = _Instrument->getChild("user-position", 0, true);
// OSG geometry setup
_radarGeode = new osg::Geode;
@ -695,7 +699,11 @@ NavDisplay::update (double delta_time_sec)
_projectMat = osg::Matrixf::scale(_scale, _scale, 1.0) *
degRotation(-_view_heading) * _centerTrans;
if (_userPositionEnable->getBoolValue()) {
_pos = SGGeod::fromDeg(_userLonNode->getDoubleValue(), _userLatNode->getDoubleValue());
} else {
_pos = globals->get_aircraft_position();
}
// invalidate the cache of positioned items, if we travelled more than 1nm
if (_cachedItemsValid) {

View file

@ -90,6 +90,7 @@ protected:
SGPropertyNode_ptr _radar_mode_control_node;
SGPropertyNode_ptr _user_heading_node;
SGPropertyNode_ptr _testModeNode;
SGPropertyNode_ptr _userLatNode, _userLonNode, _userPositionEnable;
FGODGauge *_odg;