1
0
Fork 0

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.

This commit is contained in:
ehofman 2003-05-06 14:00:18 +00:00
parent 9b2ff882af
commit b49b93f1ed

View file

@ -595,22 +595,23 @@ void fgRenderFrame() {
static int init = 50; static int init = 50;
static double sun_pos_angle = 9999.0; static double sun_pos_angle = 9999.0;
static double sun_pos_rotation = 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 = 9999.0;
static float view_heading_offset = 9999.0;
if ((fabs(sun_pos_rotation - cur_light_params.sun_rotation) > 5e-3) if ((fabs(sun_pos_rotation - cur_light_params.sun_rotation) > 5e-3)
|| (fabs(sun_pos_angle - cur_light_params.sun_angle) > 5e-3) || (fabs(sun_pos_angle - cur_light_params.sun_angle) > 5e-3)
|| (fabs(view_heading - current__view->getHeading_deg()) > 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--; init--;
sun_pos_angle = cur_light_params.sun_angle; sun_pos_angle = cur_light_params.sun_angle;
sun_pos_rotation = cur_light_params.sun_rotation; sun_pos_rotation = cur_light_params.sun_rotation;
view_heading = current__view->getHeading_deg (); view_heading = current__view->getHeading_deg ();
view_heading_offset = current__view->getHeadingOffset_deg();
thesky->repaint( cur_light_params.sky_color, thesky->repaint( cur_light_params.sky_color,
cur_light_params.adj_fog_color, cur_light_params.adj_fog_color,
@ -640,23 +641,8 @@ void fgRenderFrame() {
<< " moon ra = " << globals->get_ephem()->getMoonRightAscension() << " moon ra = " << globals->get_ephem()->getMoonRightAscension()
<< " moon dec = " << globals->get_ephem()->getMoonDeclination() ); << " 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(); thesky->reposition( current__view->get_view_pos(),
cur_long = current__view->getLongitude_deg();
cur_alt = current__view->getAltitudeASL_ft();
#endif
thesky->reposition( current__view->get_view_pos(),
current__view->get_zero_elev(), current__view->get_zero_elev(),
current__view->get_world_up(), current__view->get_world_up(),
current__view->getLongitude_deg() current__view->getLongitude_deg()
@ -673,9 +659,6 @@ void fgRenderFrame() {
globals->get_ephem()->getMoonRightAscension(), globals->get_ephem()->getMoonRightAscension(),
globals->get_ephem()->getMoonDeclination(), globals->get_ephem()->getMoonDeclination(),
50000.0 ); 50000.0 );
#if 0
}
#endif
} }
glEnable( GL_DEPTH_TEST ); glEnable( GL_DEPTH_TEST );