Moved osgParticle across to standard OSG coding style.

This commit is contained in:
Robert Osfield
2005-04-29 09:47:57 +00:00
parent 6211eb7b48
commit 6b5238c294
44 changed files with 1035 additions and 1027 deletions

View File

@@ -6,39 +6,39 @@
using namespace osg;
osgParticle::ParticleSystemUpdater::ParticleSystemUpdater()
: osg::Node(), t0_(-1)
: osg::Node(), _t0(-1)
{
setCullingActive(false);
}
osgParticle::ParticleSystemUpdater::ParticleSystemUpdater(const ParticleSystemUpdater &copy, const osg::CopyOp &copyop)
: osg::Node(copy, copyop), t0_(copy.t0_)
osgParticle::ParticleSystemUpdater::ParticleSystemUpdater(const ParticleSystemUpdater& copy, const osg::CopyOp& copyop)
: osg::Node(copy, copyop), _t0(copy._t0)
{
ParticleSystem_Vector::const_iterator i;
for (i=copy.psv_.begin(); i!=copy.psv_.end(); ++i) {
psv_.push_back(static_cast<ParticleSystem *>(copyop(i->get())));
for (i=copy._psv.begin(); i!=copy._psv.end(); ++i) {
_psv.push_back(static_cast<ParticleSystem* >(copyop(i->get())));
}
}
void osgParticle::ParticleSystemUpdater::traverse(osg::NodeVisitor &nv)
void osgParticle::ParticleSystemUpdater::traverse(osg::NodeVisitor& nv)
{
osgUtil::CullVisitor *cv = dynamic_cast<osgUtil::CullVisitor *>(&nv);
if (cv) {
if (nv.getFrameStamp())
{
double t = nv.getFrameStamp()->getReferenceTime();
if (t0_ != -1)
if (_t0 != -1)
{
ParticleSystem_Vector::iterator i;
for (i=psv_.begin(); i!=psv_.end(); ++i)
for (i=_psv.begin(); i!=_psv.end(); ++i)
{
if (!i->get()->isFrozen() && (i->get()->getLastFrameNumber() >= (nv.getFrameStamp()->getFrameNumber() - 1) || !i->get()->getFreezeOnCull()))
{
i->get()->update(t - t0_);
i->get()->update(t - _t0);
}
}
}
t0_ = t;
_t0 = t;
}
else
{