[osg-users] OsgParticle when is the particleSystemUpdater called

ivar out ivarout2 at gmail.com
Tue Aug 28 06:53:45 PDT 2018


Hi,

I found that the particle system didn't get updated due to a frame number check in osgParticle::ParticleSystemUpdater. 
if (!ps->isFrozen() && (!ps->getFreezeOnCull() || ((nv.getFrameStamp()->getFrameNumber()-ps->getLastFrameNumber()) <= 2)) )
                  {
                           ps->update(t - _t0, nv);
                   }
[/code]
I got around this problem using a perhaps somewhat dirty solution of incrementing the frame number for each viewer, each time a viewer is rendered. For example:

Code:

int frameNumber = 0;

osg::FrameStamp* fs = viewer.getFrameStamp();
fs->setFrameNumber(frameNumber++);
viewer1.frame();

// some code to update defaultParticleTemplate here...

fs = viewer2.getFrameStamp();
fs->setFrameNumber(frameNumber++);
viewer1.frame();




Cheers,
ivar

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74614#74614







More information about the osg-users mailing list