From ae1d96cdfbce0dc6204c91898c020c3705498b8b Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 20 Jan 2016 21:14:58 -0500 Subject: [PATCH] Move FOV property into View --- src/Viewer/viewer.cxx | 5 +++++ src/Viewer/viewmgr.cxx | 20 -------------------- src/Viewer/viewmgr.hxx | 3 +-- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/src/Viewer/viewer.cxx b/src/Viewer/viewer.cxx index 0a710fac9..1421ab652 100644 --- a/src/Viewer/viewer.cxx +++ b/src/Viewer/viewer.cxx @@ -249,6 +249,11 @@ View::bind () false /* do not set current property value */); fgSetArchivable("/sim/current-view/goal-roll-offset-deg"); + + _tiedProperties.Tie("field-of-view", this, + &View::get_fov, &View::set_fov); + fgSetArchivable("/sim/current-view/field-of-view"); + // expose various quaternions under the debug/ subtree _tiedProperties.Tie("debug/orientation-w", this, &View::getOrientation_w); _tiedProperties.Tie("debug/orientation-x", this, &View::getOrientation_x); diff --git a/src/Viewer/viewmgr.cxx b/src/Viewer/viewmgr.cxx index 90891d04b..ffe87bb0e 100644 --- a/src/Viewer/viewmgr.cxx +++ b/src/Viewer/viewmgr.cxx @@ -147,10 +147,6 @@ FGViewMgr::do_bind() (double_getter)0, &FGViewMgr::setViewAxisLat); fgSetArchivable("/sim/current-view/axes/lat"); - _tiedProperties.Tie("field-of-view", this, - &FGViewMgr::getFOV_deg, &FGViewMgr::setFOV_deg); - fgSetArchivable("/sim/current-view/field-of-view"); - _tiedProperties.Tie("aspect-ratio-multiplier", this, &FGViewMgr::getARM_deg, &FGViewMgr::setARM_deg); fgSetArchivable("/sim/current-view/field-of-view"); @@ -446,22 +442,6 @@ FGViewMgr::setView (int newview) update(0.0); } - -double -FGViewMgr::getFOV_deg () const -{ - const flightgear::View * view = get_current_view(); - return (view == 0 ? 0 : view->get_fov()); -} - -void -FGViewMgr::setFOV_deg (double fov) -{ - flightgear::View * view = get_current_view(); - if (view != 0) - view->set_fov(fov); -} - double FGViewMgr::getARM_deg () const { diff --git a/src/Viewer/viewmgr.hxx b/src/Viewer/viewmgr.hxx index 74b4acf08..d17648d62 100644 --- a/src/Viewer/viewmgr.hxx +++ b/src/Viewer/viewmgr.hxx @@ -102,8 +102,7 @@ private: void setViewTargetYOffset_m (double y); double getViewTargetZOffset_m () const; void setViewTargetZOffset_m (double z); - double getFOV_deg () const; - void setFOV_deg (double fov); + double getARM_deg () const; // Aspect Ratio Multiplier void setARM_deg (double fov); double getNear_m () const; -- 2.39.5