+
+ // now that we have a valid center, process all the objects
+ for (unsigned int j = 0; j < objects.size(); j++) {
+ const Object *obj = objects[j];
+
+ if (obj->type == OBJECT) {
+ SGPath custom_path = obj->path;
+ custom_path.append( obj->name );
+
+ osg::ref_ptr<osg::Group> geometry = new osg::Group;
+ osg::ref_ptr<osg::Group> vasi_lights = new osg::Group;
+ osg::ref_ptr<osg::Group> rwy_lights = new osg::Group;
+ osg::ref_ptr<osg::Group> taxi_lights = new osg::Group;
+
+ if ( obj_load( custom_path.str(),
+ geometry.get(), vasi_lights.get(), rwy_lights.get(),
+ taxi_lights.get(), NULL, false ) ) {
+
+ if ( geometry -> getNumChildren() > 0 ) {
+ new_tile -> addChild( geometry.get() );
+ }
+
+ if ( vasi_lights -> getNumChildren() > 0 )
+ vasi_lights_transform -> addChild( vasi_lights.get() );
+
+ if ( rwy_lights -> getNumChildren() > 0 )
+ rwy_lights_transform -> addChild( rwy_lights.get() );
+
+ if ( taxi_lights -> getNumChildren() > 0 )
+ taxi_lights_transform -> addChild( taxi_lights.get() );
+ }
+
+
+ } else if (obj->type == OBJECT_SHARED || obj->type == OBJECT_STATIC) {
+ // object loading is deferred to main render thread,
+ // but lets figure out the paths right now.
+ SGPath custom_path;
+ if ( obj->type == OBJECT_STATIC ) {
+ custom_path = obj->path;
+ } else {
+ custom_path = globals->get_fg_root();
+ }
+ custom_path.append( obj->name );
+
+ osg::Matrix obj_pos;
+ WorldCoordinate( obj_pos, center, obj->lat, obj->lon, obj->elev, obj->hdg );
+
+ osg::MatrixTransform *obj_trans = new osg::MatrixTransform;
+ obj_trans->setMatrix( obj_pos );
+
+ // wire as much of the scene graph together as we can
+ new_tile->addChild( obj_trans );
+ pending_models++;
+
+ // push an entry onto the model load queue
+ FGDeferredModel *dm
+ = new FGDeferredModel( custom_path.str(),
+ obj->path.str(),
+ tile_bucket,
+ this, obj_trans,
+ obj->type == OBJECT_SHARED );
+ FGTileMgr::model_ready( dm );
+
+
+ } else if (obj->type == OBJECT_SIGN || obj->type == OBJECT_RUNWAY_SIGN) {
+ // load the object itself
+ SGPath custom_path = obj->path;
+ custom_path.append( obj->name );
+
+ osg::Matrix obj_pos;
+ WorldCoordinate( obj_pos, center, obj->lat, obj->lon, obj->elev, obj->hdg );
+
+ osg::MatrixTransform *obj_trans = new osg::MatrixTransform;
+ obj_trans->setMatrix( obj_pos );
+
+ osg::Node *custom_obj = 0;
+ if (obj->type == OBJECT_SIGN)
+ custom_obj = SGMakeSign(globals->get_matlib(), custom_path.str(), obj->name);
+ else
+ custom_obj = SGMakeRunwaySign(globals->get_matlib(), custom_path.str(), obj->name);
+
+ // wire the pieces together
+ if ( custom_obj != NULL ) {
+ obj_trans -> addChild( custom_obj );
+ }
+ new_tile->addChild( obj_trans );
+
+ }
+ delete obj;
+ }
+
+