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:
parent
df9ea917dd
commit
0b77ae43a4
1 changed files with 5 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue