Change particle AngularVelocity into StartAngle and EndAngle

This commit is contained in:
Opelkuh 2021-09-05 17:08:00 +02:00
parent 6d68da8ff0
commit c2f7b01ca4
3 changed files with 7 additions and 5 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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)
{