From c695e7c788a872e83045282ac532d8a59347244c Mon Sep 17 00:00:00 2001 From: ehofman Date: Thu, 2 Feb 2006 09:57:33 +0000 Subject: [PATCH] Vassilii Khachaturov: 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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Main/renderer.cxx b/src/Main/renderer.cxx index af1f6a66d..7ccd7a754 100644 --- a/src/Main/renderer.cxx +++ b/src/Main/renderer.cxx @@ -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();