]> git.mxchange.org Git - simgear.git/commitdiff
Allow particles to be frozen on pause.
authorehofman <ehofman>
Sat, 27 Mar 2010 10:58:33 +0000 (10:58 +0000)
committerTim Moore <timoore33@gmail.com>
Sat, 27 Mar 2010 12:38:59 +0000 (13:38 +0100)
simgear/scene/model/particles.cxx
simgear/scene/model/particles.hxx

index b5687ed41e2f04465620da3927d67af118cf7af6..08037900a4c51dddc335efd0512b010bd3004ebd 100644 (file)
@@ -80,6 +80,7 @@ osg::ref_ptr<osg::Group> Particles::commonRoot;
 osg::ref_ptr<osgParticle::ParticleSystemUpdater> Particles::psu = new osgParticle::ParticleSystemUpdater;
 osg::ref_ptr<osg::Geode> Particles::commonGeode = new osg::Geode;;
 osg::Vec3 Particles::_wind;
+bool Particles::_frozen = false;
 
 Particles::Particles() : 
     useGravity(false),
@@ -510,6 +511,8 @@ osg::Group * Particles::appendParticles(const SGPropertyNode* configNode,
 void Particles::operator()(osg::Node* node, osg::NodeVisitor* nv)
 {
     //SG_LOG(SG_GENERAL, SG_ALERT, "callback!\n");
+    this->particleSys->setFrozen(_frozen);
+
     using namespace osg;
     if (shooterValue)
         shooter->setInitialSpeedRange(shooterValue->getValue(),
index b01b190a4bc52cb9a51a46196b9aa8ec98b755c5..6dda343db2628b77b7ed2c6c114e41ab598475b8 100644 (file)
@@ -75,7 +75,7 @@ public:
     }
 
     virtual void operator()(osg::Node* node, osg::NodeVisitor* nv);
-    
+
     static const osg::Vec3 &getGravityVector()
     {
         return gravity;
@@ -249,6 +249,8 @@ public:
         return psu.get();
     }
 
+    static void setFrozen(bool e) { _frozen = e; }
+
     /**
      *  Set and get the wind vector for particles in the
      * atmosphere. This vector is in the Z-up Y-north frame, and the
@@ -279,6 +281,7 @@ protected:
     
     bool useGravity;
     bool useWind;
+    static bool _frozen;
     static osg::ref_ptr<osgParticle::ParticleSystemUpdater> psu;
     static osg::ref_ptr<osg::Group> commonRoot;
     static osg::ref_ptr<osg::Geode> commonGeode;