From 663024a215d5e8f051dc4482ce1947e3641d76d2 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 25 Aug 2016 16:14:53 +0100 Subject: [PATCH] Removed redundent use of Geode to decorate the ParticleSystem --- examples/osgparticle/osgparticle.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/examples/osgparticle/osgparticle.cpp b/examples/osgparticle/osgparticle.cpp index cdff5d52a..9e24c3a60 100644 --- a/examples/osgparticle/osgparticle.cpp +++ b/examples/osgparticle/osgparticle.cpp @@ -187,11 +187,8 @@ osgParticle::ParticleSystem *create_simple_particle_system(osg::Group *root) // to create a Geode and add the particle system to it, so it can be // displayed. - osg::Geode *geode = new osg::Geode; - geode->addDrawable(ps); - - // add the geode to the scene graph - root->addChild(geode); + // add the ParticleSystem to the scene graph + root->addChild(ps); return ps; @@ -261,7 +258,7 @@ osgParticle::ParticleSystem *create_complex_particle_system(osg::Group *root) osgParticle::SectorPlacer *placer = new osgParticle::SectorPlacer; placer->setCenter(8, 0, 10); placer->setRadiusRange(2.5, 5); - placer->setPhiRange(0, 2 * osg::PI); // 360° angle to make a circle + placer->setPhiRange(0, 2 * osg::PI); // 360 angle to make a circle emitter->setPlacer(placer); // now let's setup the shooter; we use a RadialShooter but we set the @@ -312,12 +309,8 @@ osgParticle::ParticleSystem *create_complex_particle_system(osg::Group *root) // add the program to the scene graph root->addChild(program); - // create a Geode to contain our particle system. - osg::Geode *geode = new osg::Geode; - geode->addDrawable(ps); - - // add the geode to the scene graph. - root->addChild(geode); + // add the particle system to the scene graph. + root->addChild(ps); return ps; } @@ -397,7 +390,7 @@ osgParticle::ParticleSystem *create_animated_particle_system(osg::Group *root) osgParticle::SectorPlacer *placer = new osgParticle::SectorPlacer; placer->setCenter(-8, 0, 0); placer->setRadiusRange(2.5, 5); - placer->setPhiRange(0, 2 * osg::PI); // 360° angle to make a circle + placer->setPhiRange(0, 2 * osg::PI); // 360 angle to make a circle emitter1->setPlacer(placer); emitter2->setPlacer(placer);