FGTileMgr::FGTileMgr():
state( Start ),
last_state( Running ),
- vis( 16000 ),
+ longitude(-1000.0),
+ latitude(-1000.0),
+ scheduled_visibility(100.0),
_terra_sync(NULL),
_visibilityMeters(fgGetNode("/environment/visibility-m", true)),
_maxTileRangeM(fgGetNode("/sim/rendering/static-lod/bare", true)),
previous_bucket.make_bad();
current_bucket.make_bad();
longitude = latitude = -1000.0;
+ scheduled_visibility = 100.0;
_terra_sync = (simgear::SGTerraSync*) globals->get_subsystem("terrasync");
if (_terra_sync)
// << tile_height << endl;
double tileRangeM = std::min(vis,_maxTileRangeM->getDoubleValue());
- xrange = (int)(tileRangeM / tile_width) + 1;
- yrange = (int)(tileRangeM / tile_height) + 1;
+ int xrange = (int)(tileRangeM / tile_width) + 1;
+ int yrange = (int)(tileRangeM / tile_height) + 1;
if ( xrange < 1 ) { xrange = 1; }
if ( yrange < 1 ) { yrange = 1; }
// schedule more tiles when visibility increased considerably
// TODO Calculate tile size - instead of using fixed value (5000m)
- if (range_m-scheduled_visibility > 5000.0)
+ if (range_m - scheduled_visibility > 5000.0)
previous_bucket.make_bad();
// SG_LOG( SG_TERRAIN, SG_DEBUG, "Updating tile list for "
// Tile loading state
enum load_state {
- Start = 0,
- Inited = 1,
- Running = 2
+ Start = 0,
+ Inited = 1,
+ Running = 2
};
load_state state, last_state;
SGBucket pending;
osg::ref_ptr<simgear::SGReaderWriterOptions> _options;
- // x and y distance of tiles to load/draw
- float vis;
- int xrange, yrange;
-
// current longitude latitude
double longitude;
double latitude;