]> git.mxchange.org Git - flightgear.git/commitdiff
Vassilii Khachaturov:
authorehofman <ehofman>
Thu, 2 Feb 2006 09:57:33 +0000 (09:57 +0000)
committerehofman <ehofman>
Thu, 2 Feb 2006 09:57:33 +0000 (09:57 +0000)
Fix the current buggy rain orientation behaviour for the views attached to the
aircraft (while still inheriting bugs with the views attached to anything else).

src/Main/renderer.cxx

index af1f6a66d550eeb28206e40e7144c0f56a03003e..7ccd7a7544ae1c4030cdb981fc9eb6c87efae956 100644 (file)
@@ -710,14 +710,20 @@ FGRenderer::update( bool refresh_camera_settings ) {
             glDepthMask( GL_TRUE );
         }
     }
+       double current_view_origin_airspeed_horiz_kt =
+        fgGetDouble("/velocities/airspeed-kt", 0.0)
+                       * cos( fgGetDouble("/orientation/pitch-deg", 0.0)
+                               * SGD_DEGREES_TO_RADIANS);
+       // TODO:find the real view speed, not the AC one
     sgEnviro.drawPrecipitation(
         fgGetDouble("/environment/metar/rain-norm", 0.0),
         fgGetDouble("/environment/metar/snow-norm", 0.0),
         fgGetDouble("/environment/metar/hail-norm", 0.0),
-        current__view->getPitch_deg() - current__view->getPitchOffset_deg(),
+        current__view->getPitch_deg() + current__view->getPitchOffset_deg(),
         current__view->getRoll_deg() + current__view->getRollOffset_deg(),
         - current__view->getHeadingOffset_deg(),
-        fgGetDouble("/velocities/airspeed-kt", 0.0));
+               current_view_origin_airspeed_horiz_kt
+               );
 
     // compute shadows and project them on screen
     bool is_internal = globals->get_current_view()->getInternal();