From c2f7b01ca400b8286365877c3f363f247897c857 Mon Sep 17 00:00:00 2001 From: Opelkuh <25430283+Opelkuh@users.noreply.github.com> Date: Sun, 5 Sep 2021 17:08:00 +0200 Subject: [PATCH] Change particle `AngularVelocity` into `StartAngle` and `EndAngle` --- .../Skinning/Legacy/LegacyCursorStarParticles.cs | 3 ++- osu.Game/Graphics/Particles/ParticleJet.cs | 4 ++-- osu.Game/Graphics/Particles/ParticleSpewer.cs | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorStarParticles.cs b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorStarParticles.cs index d6c4d9f92a..9c901a7de5 100644 --- a/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorStarParticles.cs +++ b/osu.Game.Rulesets.Osu/Skinning/Legacy/LegacyCursorStarParticles.cs @@ -183,7 +183,8 @@ namespace osu.Game.Rulesets.Osu.Skinning.Legacy p.StartPosition = positionInParent; p.Duration = RNG.NextSingle(particle_lifetime_min, particle_lifetime_max); - p.AngularVelocity = RNG.NextSingle(-3f, 3f); + p.StartAngle = (float)(RNG.NextDouble() * 4 - 2); + p.EndAngle = RNG.NextSingle(-2f, 2f); p.EndScale = RNG.NextSingle(2f); switch (Direction) diff --git a/osu.Game/Graphics/Particles/ParticleJet.cs b/osu.Game/Graphics/Particles/ParticleJet.cs index 2d70a7f697..a76aa6b75f 100644 --- a/osu.Game/Graphics/Particles/ParticleJet.cs +++ b/osu.Game/Graphics/Particles/ParticleJet.cs @@ -12,7 +12,6 @@ namespace osu.Game.Graphics.Particles { private const int particles_per_second = 80; private const double particle_lifetime = 500; - private const float angular_velocity = 3f; private const int angle_spread = 10; private const float velocity_min = 1300f; private const float velocity_max = 1500f; @@ -39,7 +38,8 @@ namespace osu.Game.Graphics.Particles p.StartPosition = OriginPosition; p.Duration = RNG.NextSingle((float)particle_lifetime * 0.8f, (float)particle_lifetime); p.Velocity = direction * new Vector2(RNG.NextSingle(velocity_min, velocity_max)); - p.AngularVelocity = RNG.NextSingle(-angular_velocity, angular_velocity); + p.StartAngle = RNG.NextSingle(-2f, 2f); + p.EndAngle = RNG.NextSingle(-2f, 2f); p.EndScale = 2f; return p; diff --git a/osu.Game/Graphics/Particles/ParticleSpewer.cs b/osu.Game/Graphics/Particles/ParticleSpewer.cs index f9fb30abdc..3d2225d382 100644 --- a/osu.Game/Graphics/Particles/ParticleSpewer.cs +++ b/osu.Game/Graphics/Particles/ParticleSpewer.cs @@ -177,14 +177,15 @@ namespace osu.Game.Graphics.Particles public Vector2 StartPosition; public Vector2 Velocity; public float Duration; - public float AngularVelocity; + public float StartAngle; + public float EndAngle; public float EndScale; public float AlphaAtTime(float timeSinceStart) => 1 - progressAtTime(timeSinceStart); public float ScaleAtTime(float timeSinceStart) => 1 + (EndScale - 1) * progressAtTime(timeSinceStart); - public float AngleAtTime(float timeSinceStart) => AngularVelocity / 1000 * timeSinceStart; + public float AngleAtTime(float timeSinceStart) => StartAngle + (EndAngle - StartAngle) * progressAtTime(timeSinceStart); public Vector2 PositionAtTime(float timeSinceStart, float gravity) {