From c69c9d207015b1bc433aa4650ac7d781b435dd90 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 8 Mar 2006 15:26:39 +0000 Subject: [PATCH] From Farshid Lashkari, "I noticed that sometimes when a particle emitter is re-enabled, a few particles will appear at the location it was disabled at. The problem is that the previous local to world matrix is not being updated while it is disabled. I modified the particle processor so that it will set the dirty flag for the previous local to world matrix when the processor is skipped for a frame, since the value will no longer be relevant." --- src/osgParticle/ParticleProcessor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osgParticle/ParticleProcessor.cpp b/src/osgParticle/ParticleProcessor.cpp index b13b9bcbf..39580b087 100644 --- a/src/osgParticle/ParticleProcessor.cpp +++ b/src/osgParticle/ParticleProcessor.cpp @@ -108,6 +108,11 @@ void osgParticle::ParticleProcessor::traverse(osg::NodeVisitor& nv) // do some process (unimplemented in this base class) process(t - _t0); + } else { + //The values of _previous_wtl_matrix and _previous_ltw_matrix will be invalid + //since processing was skipped for this frame + _first_ltw_compute = true; + _first_wtl_compute = true; } }