#include <simgear/math/polar3d.hxx>
#include <simgear/math/sg_geodesy.hxx>
#include <simgear/math/vector.hxx>
-#include <simgear/misc/exception.hxx>
+#include <simgear/structure/exception.hxx>
+#include <simgear/scene/model/modellib.hxx>
#include <Main/globals.hxx>
#include <Main/fg_props.hxx>
#include <Main/viewer.hxx>
-#include <Model/loader.hxx>
-#include <Objects/obj.hxx>
#include "newcache.hxx"
#include "scenery.hxx"
try
{
ssgEntity *obj_model =
- globals->get_model_loader()->load_model(dm->get_model_path());
+ globals->get_model_lib()->load_model( ".",
+ dm->get_model_path(),
+ globals->get_props(),
+ globals->get_sim_time_sec() );
if ( obj_model != NULL ) {
dm->get_obj_trans()->addKid( obj_model );
}
#endif
e->add_ssg_nodes( globals->get_scenery()->get_terrain_branch(),
globals->get_scenery()->get_gnd_lights_root(),
+ globals->get_scenery()->get_taxi_lights_root(),
globals->get_scenery()->get_rwy_lights_root(),
globals->get_scenery()->get_taxi_lights_root() );
// cout << "Adding ssg nodes for "
// disk.
int FGTileMgr::update( double visibility_meters )
{
- FGLocation *location = globals->get_current_view()->getFGLocation();
+ SGLocation *location = globals->get_current_view()->getSGLocation();
sgdVec3 abs_pos_vector;
sgdCopyVec3( abs_pos_vector,
globals->get_current_view()->get_absolute_view_pos() );
}
-int FGTileMgr::update( FGLocation *location, double visibility_meters,
+int FGTileMgr::update( SGLocation *location, double visibility_meters,
sgdVec3 abs_pos_vector )
{
longitude = location->getLongitude_deg();
current_bucket.set_bucket( longitude, latitude );
// SG_LOG( SG_TERRAIN, SG_DEBUG, "Updating tile list for "
// << current_bucket );
+ fgSetInt( "/environment/current-tile-id", current_bucket.gen_index() );
// set global scenery center from current tile center
current_tile = tile_cache.get_tile( current_bucket );
// be valid (and not just luck)
hit = fgCurrentElev(abs_pos_vector,
sc,
+ // uncomment next paramater to fly under
+ // bridges and a slightly faster algorithm
+ // but you won't be able to land on aircraft carriers
// current_tile->get_terra_transform(),
&hit_list,
&hit_elev,
}
-void FGTileMgr::prep_ssg_nodes( FGLocation *location, float vis ) {
+void FGTileMgr::prep_ssg_nodes( SGLocation *location, float vis ) {
// traverse the potentially viewable tile list and update range
// selector and transform