X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Fviewer.cxx;h=57e60f48110007c8eff18f06cd0f8fc05f2271b9;hb=38226af24ec01e8f0a20d7fd73ef838a69f6ef25;hp=ffa05fc3f3499b4160771df8af9b43eb1759ee81;hpb=11a371b31377905933b2d89f752a32d1b988e5cb;p=flightgear.git diff --git a/src/Main/viewer.cxx b/src/Main/viewer.cxx index ffa05fc3f..57e60f481 100644 --- a/src/Main/viewer.cxx +++ b/src/Main/viewer.cxx @@ -28,13 +28,13 @@ #endif #include +#include #include "fg_props.hxx" #include #include #include -#include #include
#include @@ -289,7 +289,14 @@ void FGViewer::setHeadingOffset_deg (double heading_offset_deg) { _dirty = true; - _heading_offset_deg = heading_offset_deg; + if (_at_model && (_offset_m.x() == 0.0)&&(_offset_m.z() == 0.0)) + { + /* avoid optical effects (e.g. rotating sky) when "looking at" with + * heading offsets x==z==0 (view heading cannot change). */ + _heading_offset_deg = 0.0; + } + else + _heading_offset_deg = heading_offset_deg; } void @@ -317,6 +324,14 @@ void FGViewer::setGoalHeadingOffset_deg (double goal_heading_offset_deg) { _dirty = true; + if (_at_model && (_offset_m.x() == 0.0)&&(_offset_m.z() == 0.0)) + { + /* avoid optical effects (e.g. rotating sky) when "looking at" with + * heading offsets x==z==0 (view heading cannot change). */ + _goal_heading_offset_deg = 0.0; + return; + } + _goal_heading_offset_deg = goal_heading_offset_deg; while ( _goal_heading_offset_deg < 0.0 ) { _goal_heading_offset_deg += 360; @@ -651,6 +666,8 @@ FGViewer::update (double dt) } } recalc(); - _cameraGroup->update(toOsg(_absolute_view_pos), toOsg(mViewOrientation)); - _cameraGroup->setCameraParameters(get_v_fov(), get_aspect_ratio()); + if( fgGetBool( "/sim/rendering/draw-otw", true ) ) { + _cameraGroup->update(toOsg(_absolute_view_pos), toOsg(mViewOrientation)); + _cameraGroup->setCameraParameters(get_v_fov(), get_aspect_ratio()); + } }