Moved ParticleSystemUpdater into ParticleEffect nodes to simplify usage
of nodes.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <osgParticle/RadialShooter>
|
||||
#include <osgParticle/AccelOperator>
|
||||
#include <osgParticle/FluidFrictionOperator>
|
||||
#include <osgParticle/ParticleSystemUpdater>
|
||||
|
||||
#include <osg/Geode>
|
||||
|
||||
@@ -125,10 +126,13 @@ void FireEffect::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);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <osgParticle/AccelOperator>
|
||||
#include <osgParticle/FluidFrictionOperator>
|
||||
#include <osgParticle/SectorPlacer>
|
||||
#include <osgParticle/ParticleSystemUpdater>
|
||||
|
||||
#include <osg/Geode>
|
||||
|
||||
@@ -124,10 +125,13 @@ void SmokeEffect::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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user