diff --git a/components/nifosg/controller.cpp b/components/nifosg/controller.cpp index ce6ab2c488..5a3a7ac590 100644 --- a/components/nifosg/controller.cpp +++ b/components/nifosg/controller.cpp @@ -439,12 +439,15 @@ ParticleSystemController::ParticleSystemController(const ParticleSystemControlle void ParticleSystemController::operator() (osg::Node* node, osg::NodeVisitor* nv) { + osgParticle::ParticleProcessor* emitter = static_cast(node); if (hasInput()) { - osgParticle::ParticleSystem* partsys = static_cast(node); float time = getInputValue(nv); - partsys->setFrozen(!(time >= mEmitStart && time < mEmitStop)); + emitter->getParticleSystem()->setFrozen(false); + emitter->setEnabled(time >= mEmitStart && time < mEmitStop); } + else + emitter->getParticleSystem()->setFrozen(true); traverse(node, nv); } diff --git a/components/nifosg/nifloader.cpp b/components/nifosg/nifloader.cpp index 324c7796d0..172d92abeb 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); - partsys->setUpdateCallback(callback); + emitter->setUpdateCallback(callback); if (!(particleflags & Nif::NiNode::ParticleFlag_AutoPlay)) {