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:
parent
206b10d400
commit
d1982a9a8c
1 changed files with 11 additions and 3 deletions
|
@ -507,7 +507,7 @@ void fgRenderFrame() {
|
||||||
|
|
||||||
// update view port
|
// update view port
|
||||||
fgReshape( fgGetInt("/sim/startup/xsize"),
|
fgReshape( fgGetInt("/sim/startup/xsize"),
|
||||||
fgGetInt("/sim/startup/ysize") );
|
fgGetInt("/sim/startup/ysize") );
|
||||||
|
|
||||||
if ( fgGetBool("/sim/rendering/clouds3d") ) {
|
if ( fgGetBool("/sim/rendering/clouds3d") ) {
|
||||||
glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );
|
glClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );
|
||||||
|
@ -637,7 +637,14 @@ void fgRenderFrame() {
|
||||||
<< " moon dec = " << globals->get_ephem()->getMoonDeclination() );
|
<< " moon dec = " << globals->get_ephem()->getMoonDeclination() );
|
||||||
*/
|
*/
|
||||||
|
|
||||||
thesky->reposition( current__view->get_view_pos(),
|
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(),
|
||||||
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()
|
||||||
|
@ -654,6 +661,7 @@ void fgRenderFrame() {
|
||||||
globals->get_ephem()->getMoonRightAscension(),
|
globals->get_ephem()->getMoonRightAscension(),
|
||||||
globals->get_ephem()->getMoonDeclination(),
|
globals->get_ephem()->getMoonDeclination(),
|
||||||
50000.0 );
|
50000.0 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
glEnable( GL_DEPTH_TEST );
|
glEnable( GL_DEPTH_TEST );
|
||||||
|
@ -684,7 +692,7 @@ void fgRenderFrame() {
|
||||||
// glMatrixMode( GL_PROJECTION );
|
// glMatrixMode( GL_PROJECTION );
|
||||||
// glLoadIdentity();
|
// glLoadIdentity();
|
||||||
ssgSetFOV( current__view->get_h_fov(),
|
ssgSetFOV( current__view->get_h_fov(),
|
||||||
current__view->get_v_fov() );
|
current__view->get_v_fov() );
|
||||||
|
|
||||||
double agl =
|
double agl =
|
||||||
current_aircraft.fdm_state->get_Altitude() * SG_FEET_TO_METER
|
current_aircraft.fdm_state->get_Altitude() * SG_FEET_TO_METER
|
||||||
|
|
Loading…
Reference in a new issue