Separate smoke rotation seed and index

This commit is contained in:
Alden Wu 2022-10-14 12:42:04 -07:00
parent 029f896db8
commit 46bcabea6c
1 changed files with 2 additions and 6 deletions

View File

@ -234,7 +234,7 @@ public sealed override void Draw(IRenderer renderer)
if (points.Count == 0)
return;
rotationIndex = rotationSeed;
rotationIndex = 0;
quadBatch ??= renderer.CreateQuadBatch<TexturedVertex2D>(max_point_count / 10, 10);
texture ??= renderer.WhitePixel;
@ -314,11 +314,7 @@ protected virtual Vector2 PointDirection(SmokePoint point)
return new Vector2(MathF.Sin(angle), -MathF.Cos(angle));
}
private float nextRotation()
{
rotationIndex++;
return max_rotation * (StatelessRNG.NextSingle(rotationIndex) * 2 - 1);
}
private float nextRotation() => max_rotation * (StatelessRNG.NextSingle(rotationSeed, rotationIndex++) * 2 - 1);
private void drawPointQuad(SmokePoint point, RectangleF textureRect)
{