1
0
Fork 0

Reposition the sky modules only when the lat or long position is changed for 5 micro degree. This doesn't sound much, but at least it means the modules aren't repositioned every frame

This commit is contained in:
ehofman 2003-04-17 15:42:18 +00:00
parent 206b10d400
commit d1982a9a8c

View file

@ -637,6 +637,13 @@ void fgRenderFrame() {
<< " moon dec = " << globals->get_ephem()->getMoonDeclination() ); << " moon dec = " << globals->get_ephem()->getMoonDeclination() );
*/ */
if ((fabs(long_curr - current__view->getLongitude_deg()) > 5e-4)
|| (fabs(lat_curr - current__view->getLatitude_deg()) > 5e-4)
|| (init != 0))
{
lat_curr = current__view->getLatitude_deg();
long_curr = current__view->getLongitude_deg();
thesky->reposition( current__view->get_view_pos(), 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(),
@ -655,6 +662,7 @@ void fgRenderFrame() {
globals->get_ephem()->getMoonDeclination(), globals->get_ephem()->getMoonDeclination(),
50000.0 ); 50000.0 );
} }
}
glEnable( GL_DEPTH_TEST ); glEnable( GL_DEPTH_TEST );
if ( strcmp(fgGetString("/sim/rendering/fog"), "disabled") ) { if ( strcmp(fgGetString("/sim/rendering/fog"), "disabled") ) {