]> git.mxchange.org Git - flightgear.git/commitdiff
Fixed a bug with view-offset specification from the command line. There
authorcurt <curt>
Mon, 4 Mar 2002 20:12:30 +0000 (20:12 +0000)
committercurt <curt>
Mon, 4 Mar 2002 20:12:30 +0000 (20:12 +0000)
was some confusion between degrees and radians which would lead to a huge
goal_view_offset value.  The display would sit and spin for a *long* time
trying to wind it's way up to this large value.

src/Main/viewer.cxx
src/Main/viewer.hxx

index cf1e9073f5a9ca99c77a587e5235ada2a0786940..421f4b6c09bb839883c732568d9fbee594069991 100644 (file)
@@ -36,8 +36,8 @@
 
 // Constructor
 FGViewer::FGViewer( void ):
-    fov(55.0),
     scalingType(FG_SCALING_MAX),
+    fov(55.0),
     view_offset(0.0),
     goal_view_offset(0.0),
     view_tilt(0.0),
index 62b2d6c4ebf9f3709253768ca9ffe86e3bced500..b87f97caab86df7bd5349fda919525b778ad7325 100644 (file)
@@ -31,6 +31,7 @@
 #endif                                   
 
 #include <simgear/compiler.h>
+#include <simgear/constants.h>
 
 #include <plib/sg.h>           // plib include
 
@@ -167,11 +168,11 @@ public:
     inline void set_goal_view_offset( double a) {
        set_dirty();
        goal_view_offset = a;
-       while ( goal_view_offset < 0 ) {
-           goal_view_offset += 360.0;
+       while ( goal_view_offset < 0.0 ) {
+           goal_view_offset += SGD_2PI;
        }
-       while ( goal_view_offset > 360.0 ) {
-           goal_view_offset -= 360.0;
+       while ( goal_view_offset > SGD_2PI ) {
+           goal_view_offset -= SGD_2PI;
        }
     }
     inline void set_reverse_view_offset( bool val ) {