Merge branch 'master' of github.com:highfidelity/hifi into near-grab-via-parenting

This commit is contained in:
Seth Alves 2015-12-17 10:16:19 -08:00
commit 16b26bbbfd

View file

@ -595,18 +595,20 @@ void ParticleEffectEntityItem::integrateParticle(Particle& particle, float delta
void ParticleEffectEntityItem::stepSimulation(float deltaTime) {
// update particles between head and tail
int popCount = 0;
for (Particle& particle : _particles) {
particle.lifetime += deltaTime;
// if particle has died.
if (particle.lifetime >= _lifespan) {
// move head forward
_particles.pop_front();
popCount++;
} else {
// Otherwise update it
integrateParticle(particle, deltaTime);
}
}
_particles.erase(_particles.begin(), _particles.begin() + popCount);
// emit new particles, but only if we are emmitting
if (getIsEmitting() && _emitRate > 0.0f && _lifespan > 0.0f && _polarStart <= _polarFinish) {