From b49b93f1ed4e9b920c2457382cc749359d7b845b Mon Sep 17 00:00:00 2001 From: ehofman Date: Tue, 6 May 2003 14:00:18 +0000 Subject: [PATCH] Make sure the sky is also repainted when the relative view direction gets out of sync. Add a refference to /sim/rendering/debug for always repainting the sky dome. --- src/Main/main.cxx | 31 +++++++------------------------ 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 34e0c9713..6fd0c837f 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -595,22 +595,23 @@ void fgRenderFrame() { static int init = 50; static double sun_pos_angle = 9999.0; static double sun_pos_rotation = 9999.0; - static double cur_lat = 9999.0; - static double cur_long = 9999.0; - static double cur_alt = -9999.0; static float view_heading = 9999.0; + static float view_heading_offset = 9999.0; if ((fabs(sun_pos_rotation - cur_light_params.sun_rotation) > 5e-3) || (fabs(sun_pos_angle - cur_light_params.sun_angle) > 5e-3) || (fabs(view_heading - current__view->getHeading_deg()) > 5e-3) - || (init != 0)) + || (fabs(view_heading_offset + - current__view->getHeadingOffset_deg()) > 5e-3) + || init || fgGetBool("/sim/rendering/debug")) { - if (init > 0) + if ( init ) init--; sun_pos_angle = cur_light_params.sun_angle; sun_pos_rotation = cur_light_params.sun_rotation; view_heading = current__view->getHeading_deg (); + view_heading_offset = current__view->getHeadingOffset_deg(); thesky->repaint( cur_light_params.sky_color, cur_light_params.adj_fog_color, @@ -640,23 +641,8 @@ void fgRenderFrame() { << " moon ra = " << globals->get_ephem()->getMoonRightAscension() << " moon dec = " << globals->get_ephem()->getMoonDeclination() ); */ -#if 0 - if ((fabs(cur_long - current__view->getLongitude_deg()) > 5e-4) - || (fabs(cur_lat - current__view->getLatitude_deg()) > 5e-4) - || (fabs(cur_alt - current__view->getAltitudeASL_ft()) > 3) - || (init != 0)) - { - - // Hyperjump? - if ((fabs(cur_long - current__view->getLongitude_deg()) > 2) - || (fabs(cur_lat - current__view->getLatitude_deg()) > 2)) - init = 50; - cur_lat = current__view->getLatitude_deg(); - cur_long = current__view->getLongitude_deg(); - cur_alt = current__view->getAltitudeASL_ft(); -#endif - thesky->reposition( current__view->get_view_pos(), + thesky->reposition( current__view->get_view_pos(), current__view->get_zero_elev(), current__view->get_world_up(), current__view->getLongitude_deg() @@ -673,9 +659,6 @@ void fgRenderFrame() { globals->get_ephem()->getMoonRightAscension(), globals->get_ephem()->getMoonDeclination(), 50000.0 ); -#if 0 - } -#endif } glEnable( GL_DEPTH_TEST );