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.
This commit is contained in:
parent
7d8af6fee2
commit
be99e1549a
2 changed files with 6 additions and 5 deletions
|
@ -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),
|
||||
|
|
|
@ -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 ) {
|
||||
|
|
Loading…
Add table
Reference in a new issue