]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a problem with external views where the sky lighting was calculated
authorcurt <curt>
Fri, 2 Feb 2001 23:15:03 +0000 (23:15 +0000)
committercurt <curt>
Fri, 2 Feb 2001 23:15:03 +0000 (23:15 +0000)
in reverse.

src/Main/viewer.hxx
src/Main/viewer_lookat.cxx
src/Main/viewer_rph.cxx
src/Time/light.cxx

index 0854934c588586742598af6334aff0a7b39c9fa8..8c9a9311629e29e9a3d73e0315636b9ed43a95d4 100644 (file)
@@ -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;
@@ -142,6 +143,9 @@ public:
        set_dirty();
        goal_view_offset = a;
     }
+    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
        set_dirty();
@@ -168,6 +172,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; }
index fed2b3025cc84d1832c287dd4d0ce3944192ea0b..82c35cce87bed2ba50640c7b8f554083df4e6746 100644 (file)
@@ -45,6 +45,7 @@
 // Constructor
 FGViewerLookAt::FGViewerLookAt( void )
 {
+    set_reverse_view_offset(true);
 }
 
 
index a1be07d0438d95eb5ecdfc4c1a63eb0c9fab71c6..53128e7ff1387b5cc939d6c15663bc194c97b858 100644 (file)
@@ -46,6 +46,7 @@
 // Constructor
 FGViewerRPH::FGViewerRPH( void )
 {
+    set_reverse_view_offset(false);
 #ifndef USE_FAST_VIEWROT
     // This never changes -- NHV
     LARC_TO_SSG[0][0] = 0.0; 
index 4854125ce62ceffd6e5aa3be92d39fbacdd9696c..beedc1eedb871dbc1d74bc081717116bdfef3e80 100644 (file)
@@ -169,6 +169,9 @@ void fgLIGHT::UpdateAdjFog( void ) {
     // direction to the sun
     rotation = -(sun_rotation + FG_PI) 
        - (f->get_Psi() - globals->get_current_view()->get_view_offset());
+    if ( globals->get_current_view()->get_reverse_view_offset() ) {
+       rotation += FG_PI;
+    }
     while ( rotation < 0 ) {
        rotation += FG_2PI;
     }