From Marco Jez, updates to osgParticle, with integration of changes from Tom

Jolly.
This commit is contained in:
Robert Osfield
2004-03-17 20:31:55 +00:00
parent acf5a36c06
commit 3fea25a0a1
3 changed files with 119 additions and 52 deletions

View File

@@ -102,6 +102,15 @@ namespace osgParticle
/// Get the reset time of this processor.
inline double getResetTime() const;
/**
Check whether the processor is alive with respect to start time and
life duration. Note that this method may return true even if the
processor has been disabled by calling setEnabled(false). To test
whether the processor is actually processing particles or not, you
should evaluate (isEnabled() && isAlive()).
*/
inline bool isAlive() const;
void traverse(osg::NodeVisitor &nv);
/// Get the current local-to-world transformation matrix (valid only during cull traversal).
@@ -289,6 +298,11 @@ namespace osgParticle
return getWorldToLocalMatrix().preMult(P) -
getWorldToLocalMatrix().preMult(osg::Vec3(0, 0, 0));
}
inline bool ParticleProcessor::isAlive() const
{
return currentTime_ < (lifeTime_ + startTime_);
}
}