From 25a64b2cbadf03f16af51091414128dfaa29f337 Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Sun, 1 Mar 2020 18:14:12 +0000 Subject: [PATCH] src/Viewer/view.cxx: View::recalcLookAt(): Use new view[]/config/eye-fixed tag. We only look at config/eye-lon-deg-path etc if eye-fixed is true. This tag should be set to true for all views where the eye position is fixed - e.g. all Tower views plus Fly-By view in fgdata:defaults.xml. This allows b26 turret views to work without requiring modifications to the aircraft (which would break usage with older releases of fgfs). --- src/Viewer/view.cxx | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/Viewer/view.cxx b/src/Viewer/view.cxx index 355ace49c..cb640ef75 100644 --- a/src/Viewer/view.cxx +++ b/src/Viewer/view.cxx @@ -1000,17 +1000,9 @@ View::recalcLookAt () SGGeodesy::SGCartToGeod(targetCart2, _target); _position = _target; - - const std::string& tail = ViewPropertyEvaluator::getStringValue("(/sim/view[(/sim/current-view/view-number-raw)]/config/eye-lon-deg-path)"); - - if (tail != "") { - /* will typically be /sim/tower/longitude-deg, so that this view's - eye position is from the tower rather than relative to the aircraft. - If we are viewing a multiplayer aircraft, the nearest tower - will be in /sim/view[]/config/root/sim/tower/longitude-deg (see - FGEnvironmentMgr::updateClosestAirport()), so we use a prefix to select - either /sim/tower/longitude-deg or multiplayer's tower. */ + bool eye_fixed = ViewPropertyEvaluator::getBoolValue("(/sim/view[(/sim/current-view/view-number-raw)]/config/eye-fixed)"); + if (eye_fixed) { _position.setLongitudeDeg( ViewPropertyEvaluator::getDoubleValue( "((/sim/view[(/sim/current-view/view-number-raw)]/config/root)(/sim/view[(/sim/current-view/view-number-raw)]/config/eye-lon-deg-path))",