Skip to content

Commit 3bb081e

Browse files
committed
Re-sync particle emitter fix
1 parent 0f9ebfa commit 3bb081e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Source/RunActivity/Viewer3D/ParticleEmitter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,8 @@ public void Update(float currentTime, ElapsedTime elapsedTime)
394394
{
395395
time += 1 / ParticlesPerSecond;
396396

397-
var particle = (FirstFreeParticle + 1) % MaxParticles;
398-
var vertex = particle * VerticiesPerParticle;
397+
var nextFreeParticle = (FirstFreeParticle + 1) % MaxParticles;
398+
var vertex = FirstFreeParticle * VerticiesPerParticle;
399399
var texture = Viewer.Random.Next(16); // Randomizes emissions.
400400
var color_Random = new Color((float)ParticleColor.R / 255f, (float)ParticleColor.G / 255f, (float)ParticleColor.B / 255f, (float)Viewer.Random.NextDouble());
401401

@@ -426,7 +426,7 @@ public void Update(float currentTime, ElapsedTime elapsedTime)
426426
Vertices[vertex + j].Color_Random = color_Random;
427427
}
428428

429-
FirstFreeParticle = particle;
429+
FirstFreeParticle = nextFreeParticle;
430430
}
431431

432432
TimeParticlesLastEmitted = time;

0 commit comments

Comments
 (0)