From 4ea7fc63271ba43650daa359f264e4269f41b048 Mon Sep 17 00:00:00 2001 From: frohlich Date: Thu, 31 Aug 2006 05:07:50 +0000 Subject: [PATCH] Attemp to fix the 'bogous tile problem' --- src/Main/main.cxx | 20 ++++++++++++++++++++ src/Main/renderer.cxx | 21 --------------------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 42f8e02d2..ce6a79aed 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -513,6 +513,26 @@ static void fgMainLoop( void ) { // double visibility_meters = fgGetDouble("/environment/visibility-m"); FGViewer *current_view = globals->get_current_view(); + // Let the scenery center follow the current view position with + // 30m increments. + // + // Having the scenery center near the view position will eliminate + // jitter of objects which are placed very near the view position + // and haveing it's center near that view position. + // So the 3d insruments of the aircraft will not jitter with this. + // + // Following the view position exactly would introduce jitter of + // the scenery tiles (they would be from their center up to 10000m + // to the view and this will introduce roundoff too). By stepping + // at 30m incements the roundoff error of the scenery tiles is + // still present, but we will make exactly the same roundoff error + // at each frame until the center is switched to a new + // position. This roundoff is still visible but you will most + // propably not notice. + double *vp = globals->get_current_view()->get_absolute_view_pos(); + SGVec3d cntr(vp); + if (30.0*30.0 < distSqr(cntr, globals->get_scenery()->get_center())) + globals->get_scenery()->set_center( cntr ); globals->get_tile_mgr()->prep_ssg_nodes( current_view->getSGLocation(), visibility_meters ); diff --git a/src/Main/renderer.cxx b/src/Main/renderer.cxx index e8d449774..0a6077bf9 100644 --- a/src/Main/renderer.cxx +++ b/src/Main/renderer.cxx @@ -232,27 +232,6 @@ FGRenderer::update( bool refresh_camera_settings ) { return; } - // Let the scenery center follow the current view position with - // 30m increments. - // - // Having the scenery center near the view position will eliminate - // jitter of objects which are placed very near the view position - // and haveing it's center near that view position. - // So the 3d insruments of the aircraft will not jitter with this. - // - // Following the view position exactly would introduce jitter of - // the scenery tiles (they would be from their center up to 10000m - // to the view and this will introduce roundoff too). By stepping - // at 30m incements the roundoff error of the scenery tiles is - // still present, but we will make exactly the same roundoff error - // at each frame until the center is switched to a new - // position. This roundoff is still visible but you will most - // propably not notice. - double *vp = globals->get_current_view()->get_absolute_view_pos(); - SGVec3d cntr(vp); - if (30.0*30.0 < distSqr(cntr, globals->get_scenery()->get_center())) - globals->get_scenery()->set_center( cntr ); - bool draw_otw = fgGetBool("/sim/rendering/draw-otw"); bool skyblend = fgGetBool("/sim/rendering/skyblend"); bool use_point_sprites = fgGetBool("/sim/rendering/point-sprites"); -- 2.39.5