From Jannik Heller, osgParticle freeze on cull fix, ammended by Robert Osfield to make if statements a little more readable.

This commit is contained in:
Robert Osfield
2016-02-23 10:12:31 +00:00
parent e8ac5af41b
commit 31fad1476f
2 changed files with 7 additions and 2 deletions

View File

@@ -99,10 +99,12 @@ void osgParticle::ParticleProcessor::traverse(osg::NodeVisitor& nv)
_currentTime += t - _t0;
// process only if the particle system is not frozen/culled
// We need to allow at least 2 frames difference, because the particle system's lastFrameNumber
// is updated in the draw thread which may not have completed yet.
if (alive &&
_enabled &&
!_ps->isFrozen() &&
((_ps->getLastFrameNumber()+1) >= (nv.getFrameStamp()->getFrameNumber()) || !_ps->getFreezeOnCull()))
(!_ps->getFreezeOnCull() || ((nv.getFrameStamp()->getFrameNumber()-_ps->getLastFrameNumber()) <= 2)) )
{
// initialize matrix flags
_need_ltw_matrix = true;