]> git.mxchange.org Git - flightgear.git/commitdiff
Attemp to fix the 'bogous tile problem'
authorfrohlich <frohlich>
Thu, 31 Aug 2006 05:07:50 +0000 (05:07 +0000)
committerfrohlich <frohlich>
Thu, 31 Aug 2006 05:07:50 +0000 (05:07 +0000)
src/Main/main.cxx
src/Main/renderer.cxx

index 42f8e02d21cbd39f82d06f49a0e197af50befa54..ce6a79aed47f60bb488419d5cc74b83930b17cb9 100644 (file)
@@ -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 );
index e8d449774b58b9bd5c72eead22074617b97cecc6..0a6077bf9af5b7921e0a5d0ec2cb271379e7cbc8 100644 (file)
@@ -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");