Discussion:
[osg-users] OsgParticle when is the particleSystemUpdater called
ivar out
2018-08-28 13:53:45 UTC
Permalink
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

Loading...