fgReInitSubsystems();
- global_tile_mgr.update( fgGetDouble("/position/longitude-deg"),
- fgGetDouble("/position/latitude-deg"),
- fgGetDouble("/environment/visibility-m") );
+ global_tile_mgr.update( fgGetDouble("/environment/visibility-m") );
cur_light_params.Update();
cout << "before tile_mgr init " << longitude->getDoubleValue() << " "
<< latitude->getDoubleValue() << endl;
- double visibility_meters =
- fgGetDouble("/environment/visibility-m");
- global_tile_mgr.update( longitude->getDoubleValue(),
- latitude->getDoubleValue(),
- visibility_meters );
+ double visibility_meters = fgGetDouble("/environment/visibility-m");
+ global_tile_mgr.update( visibility_meters );
// BusyCursor(1);
if ( !freeze ) {
if ( global_tile_mgr.init() ) {
// Load the local scenery data
double visibility_meters = fgGetDouble("/environment/visibility-m");
- global_tile_mgr.update(fgGetDouble("/position/longitude-deg"),
- fgGetDouble("/position/latitude-deg"),
- visibility_meters);
+ global_tile_mgr.update( visibility_meters );
} else {
SG_LOG( SG_GENERAL, SG_ALERT,
"Error in Tile Manager initialization!" );
// Load the local scenery data
double visibility_meters = fgGetDouble("/environment/visibility-m");
- global_tile_mgr.update( longitude->getDoubleValue(),
- latitude->getDoubleValue(),
- visibility_meters );
+ global_tile_mgr.update( visibility_meters );
} else {
SG_LOG( SG_GENERAL, SG_ALERT, "Error in Tile Manager initialization!" );
exit(-1);
if( acmodel_location != current_view->getFGLocation() ) {
if( acmodel_location != 0 ) {
global_tile_mgr.prep_ssg_nodes( acmodel_location, visibility_meters );
- global_tile_mgr.update( acmodel_location->getLongitude_deg(),
- acmodel_location->getLatitude_deg(),
- visibility_meters,
- acmodel_location->get_absolute_view_pos(),
- acmodel_location->get_current_bucket(),
- acmodel_location->get_previous_bucket(),
- acmodel_location->get_tile_center()
- );
+ global_tile_mgr.update( acmodel_location, visibility_meters,
+ acmodel_location->get_absolute_view_pos(),
+ acmodel_location->get_current_bucket(),
+ acmodel_location->get_previous_bucket(),
+ acmodel_location->get_tile_center()
+ );
// save results of update in FGLocation for fdm...
if ( globals->get_scenery()->get_cur_elev() > -9990 ) {
acmodel_location->set_cur_elev_m( globals->get_scenery()->get_cur_elev() );
// IMPORTANT!!! the tilemgr update for view location _must_ be done last
// after the FDM's until all of Flight Gear code references the viewer's location
// for elevation instead of the "scenery's" current elevation.
- global_tile_mgr.update( current_view->getLongitude_deg(),
- current_view->getLatitude_deg(),
- visibility_meters,
+ FGLocation *view_location = globals->get_current_view()->getFGLocation();
+ global_tile_mgr.update( view_location, visibility_meters,
current_view->get_absolute_view_pos(),
current_view->getFGLocation()->get_current_bucket(),
current_view->getFGLocation()->get_previous_bucket(),
// given the current lon/lat (in degrees), fill in the array of local
// chunks. If the chunk isn't already in the cache, then read it from
// disk.
-int FGTileMgr::update( double lon, double lat, double visibility_meters ) {
+int FGTileMgr::update( double visibility_meters ) {
+ FGLocation *location = globals->get_current_view()->getFGLocation();
sgdVec3 abs_pos_vector;
- sgdCopyVec3(abs_pos_vector , globals->get_current_view()->get_absolute_view_pos());
- return update( lon, lat, visibility_meters, abs_pos_vector,
+ sgdCopyVec3( abs_pos_vector,
+ globals->get_current_view()->get_absolute_view_pos() );
+ return update( location, visibility_meters, abs_pos_vector,
current_bucket, previous_bucket,
globals->get_scenery()->get_center() );
}
}
-int FGTileMgr::update( double lon, double lat, double visibility_meters,
+int FGTileMgr::update( FGLocation *location, double visibility_meters,
sgdVec3 abs_pos_vector, SGBucket p_current,
SGBucket p_previous, Point3D center ) {
// SG_LOG( SG_TERRAIN, SG_DEBUG, "FGTileMgr::update() for "
// << lon << " " << lat );
- longitude = lon;
- latitude = lat;
+ longitude = location->getLongitude_deg();
+ latitude = location->getLatitude_deg();
current_bucket = p_current;
previous_bucket = p_previous;
// given the current lon/lat (in degrees), fill in the array of
// local chunks. If the chunk isn't already in the cache, then
// read it from disk.
- int update( double lon, double lat, double visibility_meters );
- int update( double lon, double lat, double visibility_meters, sgdVec3 abs_pos_vector, SGBucket p_current, SGBucket p_previous, Point3D center );
+ int update( double visibility_meters );
+ int update( FGLocation *location, double visibility_meters,
+ sgdVec3 abs_pos_vector, SGBucket p_current,
+ SGBucket p_previous, Point3D center );
void setCurrentTile( double longitude, double latitude );
int updateCurrentElevAtPos(sgdVec3 abs_pos_vector, Point3D center );