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:
parent
1fc105582e
commit
189896a7ab
1 changed files with 4 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue