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:
parent
41481967f1
commit
a6dc2beb4d
2 changed files with 12 additions and 3 deletions
|
@ -562,6 +562,10 @@ NavDisplay::init ()
|
||||||
_testModeNode->setBoolValue(false);
|
_testModeNode->setBoolValue(false);
|
||||||
|
|
||||||
_viewHeadingNode = _Instrument->getChild("view-heading-deg", 0, true);
|
_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
|
// OSG geometry setup
|
||||||
_radarGeode = new osg::Geode;
|
_radarGeode = new osg::Geode;
|
||||||
|
|
||||||
|
@ -695,8 +699,12 @@ NavDisplay::update (double delta_time_sec)
|
||||||
_projectMat = osg::Matrixf::scale(_scale, _scale, 1.0) *
|
_projectMat = osg::Matrixf::scale(_scale, _scale, 1.0) *
|
||||||
degRotation(-_view_heading) * _centerTrans;
|
degRotation(-_view_heading) * _centerTrans;
|
||||||
|
|
||||||
_pos = globals->get_aircraft_position();
|
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
|
// invalidate the cache of positioned items, if we travelled more than 1nm
|
||||||
if (_cachedItemsValid) {
|
if (_cachedItemsValid) {
|
||||||
SGVec3d cartNow(SGVec3d::fromGeod(_pos));
|
SGVec3d cartNow(SGVec3d::fromGeod(_pos));
|
||||||
|
|
|
@ -90,7 +90,8 @@ protected:
|
||||||
SGPropertyNode_ptr _radar_mode_control_node;
|
SGPropertyNode_ptr _radar_mode_control_node;
|
||||||
SGPropertyNode_ptr _user_heading_node;
|
SGPropertyNode_ptr _user_heading_node;
|
||||||
SGPropertyNode_ptr _testModeNode;
|
SGPropertyNode_ptr _testModeNode;
|
||||||
|
SGPropertyNode_ptr _userLatNode, _userLonNode, _userPositionEnable;
|
||||||
|
|
||||||
FGODGauge *_odg;
|
FGODGauge *_odg;
|
||||||
|
|
||||||
// Convenience function for creating a property node with a
|
// Convenience function for creating a property node with a
|
||||||
|
|
Loading…
Add table
Reference in a new issue