Merge branch 'ehofman/particles'

This commit is contained in:
Tim Moore
2010-04-25 22:36:06 +02:00
2 changed files with 7 additions and 1 deletions
+3
View 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<osgParticle::ParticleSystemUpdater> Particles::psu = new osgParticle::ParticleSystemUpdater;
osg::ref_ptr<osg::Geode> Particles::commonGeode = new osg::Geode;; osg::ref_ptr<osg::Geode> Particles::commonGeode = new osg::Geode;;
osg::Vec3 Particles::_wind; osg::Vec3 Particles::_wind;
bool Particles::_frozen = false;
Particles::Particles() : Particles::Particles() :
useGravity(false), useGravity(false),
@@ -510,6 +511,8 @@ osg::Group * Particles::appendParticles(const SGPropertyNode* configNode,
void Particles::operator()(osg::Node* node, osg::NodeVisitor* nv) void Particles::operator()(osg::Node* node, osg::NodeVisitor* nv)
{ {
//SG_LOG(SG_GENERAL, SG_ALERT, "callback!\n"); //SG_LOG(SG_GENERAL, SG_ALERT, "callback!\n");
this->particleSys->setFrozen(_frozen);
using namespace osg; using namespace osg;
if (shooterValue) if (shooterValue)
shooter->setInitialSpeedRange(shooterValue->getValue(), shooter->setInitialSpeedRange(shooterValue->getValue(),
+3
View File
@@ -249,6 +249,8 @@ public:
return psu.get(); return psu.get();
} }
static void setFrozen(bool e) { _frozen = e; }
/** /**
* Set and get the wind vector for particles in the * Set and get the wind vector for particles in the
* atmosphere. This vector is in the Z-up Y-north frame, and the * atmosphere. This vector is in the Z-up Y-north frame, and the
@@ -279,6 +281,7 @@ protected:
bool useGravity; bool useGravity;
bool useWind; bool useWind;
static bool _frozen;
static osg::ref_ptr<osgParticle::ParticleSystemUpdater> psu; static osg::ref_ptr<osgParticle::ParticleSystemUpdater> psu;
static osg::ref_ptr<osg::Group> commonRoot; static osg::ref_ptr<osg::Group> commonRoot;
static osg::ref_ptr<osg::Geode> commonGeode; static osg::ref_ptr<osg::Geode> commonGeode;