Updates from Geoff Michel to geo loader and demo.

This commit is contained in:
Robert Osfield
2002-12-10 20:00:56 +00:00
parent 64c5fb644a
commit 530b85c807
15 changed files with 3606 additions and 2204 deletions

View File

@@ -39,7 +39,9 @@ osgParticle::ParticleProcessor::ParticleProcessor(const ParticleProcessor &copy,
void osgParticle::ParticleProcessor::traverse(osg::NodeVisitor &nv)
{
// continue only if enabled
if (enabled_) {
if (enabled_ )
{
// typecast the NodeVisitor to CullVisitor
osgUtil::CullVisitor *cv = dynamic_cast<osgUtil::CullVisitor *>(&nv);
@@ -48,35 +50,45 @@ void osgParticle::ParticleProcessor::traverse(osg::NodeVisitor &nv)
if (cv) {
// continue only if the particle system is valid
if (ps_.valid()) {
if (ps_.valid())
{
// retrieve the current time
double t = nv.getFrameStamp()->getReferenceTime();
if (nv.getFrameStamp())
{
// skip if we haven't initialized t0_ yet
if (t0_ != -1) {
// retrieve the current time
double t = nv.getFrameStamp()->getReferenceTime();
// check whether the particle system is frozen/culled
if (!ps_->isFrozen() && (ps_->getLastFrameNumber() >= (nv.getFrameStamp()->getFrameNumber() - 1) || !ps_->getFreezeOnCull())) {
// skip if we haven't initialized t0_ yet
if (t0_ != -1) {
// initialize matrix flags
need_ltw_matrix_ = true;
need_wtl_matrix_ = true;
current_nodevisitor_ = &nv;
// check whether the particle system is frozen/culled
if (!ps_->isFrozen() && (ps_->getLastFrameNumber() >= (nv.getFrameStamp()->getFrameNumber() - 1) || !ps_->getFreezeOnCull())) {
// do some process (unimplemented in this base class)
process(t - t0_);
// initialize matrix flags
need_ltw_matrix_ = true;
need_wtl_matrix_ = true;
current_nodevisitor_ = &nv;
// do some process (unimplemented in this base class)
process(t - t0_);
}
}
// update t0_
t0_ = t;
}
else
{
osg::notify(osg::WARN) << "osgParticle::ParticleProcessor::traverse(NodeVisitor&) requires a valid FrameStamp to function, particles not updated.\n";
}
// update t0_
t0_ = t;
} else {
} else
{
osg::notify(osg::WARN) << "ParticleProcessor \"" << getName() << "\": invalid particle system\n";
}
}
}
// call the inherited method