]> git.mxchange.org Git - flightgear.git/blobdiff - src/Scenery/tilemgr.cxx
Mathias Fröhlich:
[flightgear.git] / src / Scenery / tilemgr.cxx
index 9b28c8894939dd70f10612af69d84c166746be02..af7195b44cb62aa23fff879a769a6541ac3ac9ef 100644 (file)
@@ -156,7 +156,7 @@ void FGTileMgr::sched_tile( const SGBucket& b, const bool is_inner_ring ) {
 
 
 // schedule a needed buckets for loading
-void FGTileMgr::schedule_needed( double vis, SGBucket curr_bucket) {
+void FGTileMgr::schedule_needed( double vis, const SGBucket& curr_bucket) {
     // sanity check (unfortunately needed!)
     if ( longitude < -180.0 || longitude > 180.0 
          || latitude < -90.0 || latitude > 90.0 )
@@ -457,18 +457,17 @@ void FGTileMgr::prep_ssg_nodes( SGLocation *location, float vis ) {
     // traverse the potentially viewable tile list and update range
     // selector and transform
 
-    Point3D center = location->get_tile_center();
-    if (center == Point3D(0.0))
-      return;
     float *up = location->get_world_up();
 
     FGTileEntry *e;
     tile_cache.reset_traversal();
 
+    const double *vp = location->get_absolute_view_pos();
+    Point3D viewpos(vp[0], vp[1], vp[2]);
     while ( ! tile_cache.at_end() ) {
         // cout << "processing a tile" << endl;
         if ( (e = tile_cache.get_current()) ) {
-            e->prep_ssg_node( center, up, vis);
+            e->prep_ssg_node( viewpos, up, vis);
         } else {
             SG_LOG(SG_INPUT, SG_ALERT, "warning ... empty tile in cache");
         }