smrendererv3/SMCode/SM.Base/Drawing/Particles/ParticleMovement.cs
Michel Fedde db7f01dca1 Rewrote the particles to allow for more advanced particles.
+ Particles can now be detached from the object.
+ Each particle now has an own Lifetime, that can be controlled.
+ Particles can now appear in a continuous way.
2021-05-11 21:44:45 +02:00

30 lines
No EOL
796 B
C#

#region usings
using OpenTK;
#endregion
namespace SM.Base.Drawing.Particles
{
/// <summary>
/// Contains methods for particle movements.
/// </summary>
public class ParticleMovement
{
/// <summary>
/// Default movement for 2D.
/// </summary>
public static Vector2 Default2D(ParticleInstance<Vector2> particle)
{
return particle.Direction * ((particle.StartLifetime - particle.Lifetime) * particle.Speed);
}
/// <summary>
/// Default movement for 3D.
/// </summary>
public static Vector3 Default3D(ParticleInstance<Vector3> particle)
{
return particle.Direction * ((particle.StartLifetime - particle.Lifetime) * particle.Speed);
}
}
}