From d57bc67420b2229cc4d1f9882f337537ed490e69 Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 3 Feb 2021 21:11:00 +0000 Subject: [PATCH] Particles: changes to support new API in SimGear Matches corresponding SimGear rewrite of global particle manager code. --- src/Environment/environment_mgr.cxx | 3 +++ src/Scenery/scenery.cxx | 1 + 2 files changed, 4 insertions(+) diff --git a/src/Environment/environment_mgr.cxx b/src/Environment/environment_mgr.cxx index 227140130..161126955 100644 --- a/src/Environment/environment_mgr.cxx +++ b/src/Environment/environment_mgr.cxx @@ -269,6 +269,9 @@ FGEnvironmentMgr::update (double dt) auto particlesManager = simgear::ParticlesGlobalManager::instance(); particlesManager->setWindFrom(_environment->get_wind_from_heading_deg(), _environment->get_wind_speed_kt()); + particlesManager->setSimTime(dt); + particlesManager->setCurrentPosition(globals->get_aircraft_position()); + if( _cloudLayersDirty ) { _cloudLayersDirty = false; fgClouds->set_update_event( fgClouds->get_update_event()+1 ); diff --git a/src/Scenery/scenery.cxx b/src/Scenery/scenery.cxx index 525f02cf6..412c100e1 100644 --- a/src/Scenery/scenery.cxx +++ b/src/Scenery/scenery.cxx @@ -456,6 +456,7 @@ void FGScenery::init() { particles_branch->setName("Particles"); scene_graph->addChild(particles_branch.get()); paricles->setSwitchNode(fgGetNode("/sim/rendering/particles", true)); + paricles->initFromMainThread(); // Set up the precipitation system. precipitation_branch = new osg::Group;