1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-29 21:45:32 +00:00

Minor optimization for particle emitters

This commit is contained in:
scrawl 2015-04-09 16:51:57 +02:00
parent df9ea917dd
commit 0b77ae43a4

View file

@ -238,7 +238,12 @@ void Emitter::setCounter(osgParticle::Counter *counter)
void Emitter::emitParticles(double dt)
{
int n = mCounter->numParticlesToCreate(dt);
if (n == 0)
return;
osg::Matrix worldToPs;
// maybe this could be optimized by halting at the lowest common ancestor of the particle and emitter nodes
osg::MatrixList worldMats = getParticleSystem()->getWorldMatrices();
if (!worldMats.empty())
@ -271,8 +276,6 @@ void Emitter::emitParticles(double dt)
emitterToPs.orthoNormalize(emitterToPs);
int n = mCounter->numParticlesToCreate(dt);
for (int i=0; i<n; ++i)
{
osgParticle::Particle* P = getParticleSystem()->createParticle(0);