From be99e1549a648200b81d98ce73cb6e1de9f88906 Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 4 Mar 2002 20:12:30 +0000 Subject: [PATCH] Fixed a bug with view-offset specification from the command line. There 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 | 2 +- src/Main/viewer.hxx | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Main/viewer.cxx b/src/Main/viewer.cxx index cf1e9073f..421f4b6c0 100644 --- a/src/Main/viewer.cxx +++ b/src/Main/viewer.cxx @@ -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), diff --git a/src/Main/viewer.hxx b/src/Main/viewer.hxx index 62b2d6c4e..b87f97caa 100644 --- a/src/Main/viewer.hxx +++ b/src/Main/viewer.hxx @@ -31,6 +31,7 @@ #endif #include +#include #include // 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 ) {