Use new thread-safe particles manager.
Requires corresponding SG commit
This commit is contained in:
parent
2295e82a0f
commit
86f6b94300
4 changed files with 9 additions and 6 deletions
|
@ -266,8 +266,9 @@ FGEnvironmentMgr::update (double dt)
|
|||
SGGeod aircraftPos(globals->get_aircraft_position());
|
||||
_environment->set_elevation_ft( aircraftPos.getElevationFt() );
|
||||
|
||||
simgear::Particles::setWindFrom( _environment->get_wind_from_heading_deg(),
|
||||
_environment->get_wind_speed_kt() );
|
||||
auto particlesManager = simgear::ParticlesGlobalManager::instance();
|
||||
particlesManager->setWindFrom(_environment->get_wind_from_heading_deg(),
|
||||
_environment->get_wind_speed_kt());
|
||||
if( _cloudLayersDirty ) {
|
||||
_cloudLayersDirty = false;
|
||||
fgClouds->set_update_event( fgClouds->get_update_event()+1 );
|
||||
|
|
|
@ -1309,7 +1309,7 @@ void fgStartNewReset()
|
|||
simgear::clearSharedTreeGeometry();
|
||||
simgear::clearEffectCache();
|
||||
simgear::SGModelLib::resetPropertyRoot();
|
||||
simgear::GlobalParticleCallback::setSwitch(NULL);
|
||||
simgear::ParticlesGlobalManager::clear();
|
||||
simgear::UniformFactory::instance()->reset();
|
||||
|
||||
flightgear::addons::AddonManager::reset();
|
||||
|
|
|
@ -229,7 +229,8 @@ setFreeze (bool f)
|
|||
frozen = f;
|
||||
|
||||
// Pause the particle system
|
||||
simgear::Particles::setFrozen(f);
|
||||
auto p = simgear::ParticlesGlobalManager::instance();
|
||||
p->setFrozen(f);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -391,10 +391,11 @@ void FGScenery::init() {
|
|||
aircraft_branch->addChild( interiorLOD );
|
||||
|
||||
// Set up the particle system as a directly accessible branch of the scene graph.
|
||||
particles_branch = simgear::Particles::getCommonRoot();
|
||||
auto paricles = simgear::ParticlesGlobalManager::instance();
|
||||
particles_branch = paricles->getCommonRoot();
|
||||
particles_branch->setName("Particles");
|
||||
scene_graph->addChild(particles_branch.get());
|
||||
simgear::GlobalParticleCallback::setSwitch(fgGetNode("/sim/rendering/particles", true));
|
||||
paricles->setSwitchNode(fgGetNode("/sim/rendering/particles", true));
|
||||
|
||||
// Set up the precipitation system.
|
||||
precipitation_branch = new osg::Group;
|
||||
|
|
Loading…
Reference in a new issue