1
0
Fork 0

only call occluder if the shadows were already initialized. This lead to

a crash when using the model manager from XML files (which apparently
nobody does, anyway ;-)  Now those models work (again), but have no
shadows. Those placed at runtime (e.g. via ufo) still have a shadow.
This commit is contained in:
mfranz 2006-04-12 11:12:36 +00:00
parent 1fc105582e
commit 189896a7ab

View file

@ -81,6 +81,7 @@ FGModelMgr::add_model (SGPropertyNode * node)
globals->get_sim_time_sec(), /*cache_object=*/false);
model->init( object );
if (shadows)
shadows->addOccluder((ssgBranch *)object, SGShadowVolume::occluderTypeTileObject);
// Set position and orientation either
@ -258,6 +259,7 @@ FGModelMgr::Listener::childRemoved(SGPropertyNode * parent, SGPropertyNode * chi
_mgr->_instances.erase(it);
ssgBranch *branch = (ssgBranch *)instance->model->getSceneGraph();
if (shadows)
shadows->deleteOccluder(branch);
globals->get_scenery()->get_scene_graph()->removeKid(branch);