Moved ParticleSystemUpdater into ParticleEffect nodes to simplify usage

of nodes.
This commit is contained in:
Robert Osfield
2005-03-22 20:26:45 +00:00
parent 1c808e4959
commit 0b2ac40fe8
4 changed files with 36 additions and 21 deletions

View File

@@ -21,6 +21,7 @@
#include <osgParticle/RadialShooter>
#include <osgParticle/AccelOperator>
#include <osgParticle/FluidFrictionOperator>
#include <osgParticle/ParticleSystemUpdater>
#include <osg/Geode>
@@ -128,10 +129,13 @@ void ExplosionEffect::buildEffect()
// add the program to update the particles
addChild(_program.get());
osg::Geode *geode = new osg::Geode;
geode->addDrawable(_particleSystem.get());
//geode->setCullingActive(false);
// add the particle system updater.
osgParticle::ParticleSystemUpdater *psu = new osgParticle::ParticleSystemUpdater;
psu->addParticleSystem(_particleSystem.get());
addChild(psu);
// add the geode to the scene graph
osg::Geode *geode = new osg::Geode;
geode->addDrawable(_particleSystem.get());
addChild(geode);
}