Fixed particle update bug where a ParticleSystem wouldn't start when loaded during the frame loop due to the _last_frame value not being set.

This commit is contained in:
Robert Osfield
2018-04-27 11:23:07 +01:00
parent c9b0fcaa32
commit 31c9dbc881

View File

@@ -211,8 +211,6 @@ void osgParticle::ParticleSystem::update(double dt, osg::NodeVisitor& nv)
void osgParticle::ParticleSystem::drawImplementation(osg::RenderInfo& renderInfo) const
{
if (_particles.size() <= 0) return;
ScopedReadLock lock(_readWriteMutex);
osg::State& state = *renderInfo.getState();
@@ -221,6 +219,8 @@ void osgParticle::ParticleSystem::drawImplementation(osg::RenderInfo& renderInfo
// this particle system is culled
_last_frame = state.getFrameStamp()->getFrameNumber();
if (_particles.size() <= 0) return;
// update the dirty flag of delta time, so next time a new request for delta time
// will automatically cause recomputing
_dirty_dt = true;