From 0c08f705c5f07354c216535d757230384c1264ed Mon Sep 17 00:00:00 2001 From: scrawl Date: Sat, 14 May 2016 22:36:53 +0200 Subject: [PATCH] Make the ParticleSystemController freeze the particle system instead of the emitter (Bug #3390) --- components/nifosg/controller.cpp | 4 ++-- components/nifosg/nifloader.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/nifosg/controller.cpp b/components/nifosg/controller.cpp index aabe07c86..ce6ab2c48 100644 --- a/components/nifosg/controller.cpp +++ b/components/nifosg/controller.cpp @@ -441,9 +441,9 @@ void ParticleSystemController::operator() (osg::Node* node, osg::NodeVisitor* nv { if (hasInput()) { - osgParticle::ParticleProcessor* emitter = static_cast(node); + osgParticle::ParticleSystem* partsys = static_cast(node); float time = getInputValue(nv); - emitter->setEnabled(time >= mEmitStart && time < mEmitStop); + partsys->setFrozen(!(time >= mEmitStart && time < mEmitStop)); } traverse(node, nv); } diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 874ca9eaa..b5311953e 100644 --- a/components/nifosg/nifloader.cpp +++ b/components/nifosg/nifloader.cpp @@ -994,7 +994,7 @@ namespace NifOsg osg::ref_ptr callback(new ParticleSystemController(partctrl)); setupParticleController(partctrl, callback, particleflags); - emitter->setUpdateCallback(callback); + partsys->setUpdateCallback(callback); } // affectors must be attached *after* the emitter in the scene graph for correct update order