X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Fviewer.hxx;h=107401a373fa572b73e82251c09718a63caaa104;hb=4141c6f8bb42b3491502f5e6b82595367da9fb69;hp=0854934c588586742598af6334aff0a7b39c9fa8;hpb=5175227e3b948166f58d9e3e387788e77884f2b9;p=flightgear.git diff --git a/src/Main/viewer.hxx b/src/Main/viewer.hxx index 0854934c5..107401a37 100644 --- a/src/Main/viewer.hxx +++ b/src/Main/viewer.hxx @@ -68,6 +68,7 @@ protected: // the current view offset angle from forward (rotated about the // view_up vector) double view_offset; + bool reverse_view_offset; // the goal view offset angle (used for smooth view changes) double goal_view_offset; @@ -115,7 +116,7 @@ protected: inline void set_clean() { dirty = false; } // Update the view volume, position, and orientation - virtual void update(); + virtual void update() = 0; public: @@ -141,6 +142,15 @@ 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 > 360.0 ) { + goal_view_offset -= 360.0; + } + } + inline void set_reverse_view_offset( bool val ) { + reverse_view_offset = val; } inline void set_geod_view_pos( double lon, double lat, double alt ) { // data should be in radians and meters asl @@ -168,6 +178,7 @@ public: inline double get_fov() const { return fov; } inline double get_win_ratio() const { return win_ratio; } inline double get_view_offset() const { return view_offset; } + inline bool get_reverse_view_offset() const { return reverse_view_offset; } inline double get_goal_view_offset() const { return goal_view_offset; } inline double *get_geod_view_pos() { return geod_view_pos; } inline float *get_pilot_offset() { return pilot_offset; }