moved the particle system and the entity component system into their own nuget packages

This commit is contained in:
Dylan Wilson
2017-03-07 22:08:31 +10:00
parent 1b6df14681
commit c236e6dfd5
71 changed files with 422 additions and 83 deletions
@@ -0,0 +1,23 @@
using Microsoft.Xna.Framework;
namespace MonoGame.Extended.Particles.Modifiers
{
public class DragModifier : IModifier
{
public float DragCoefficient { get; set; } = 0.47f;
public float Density { get; set; } = .5f;
public unsafe void Update(float elapsedSeconds, ParticleBuffer.ParticleIterator iterator)
{
while (iterator.HasNext)
{
var particle = iterator.Next();
var drag = -DragCoefficient*Density*particle->Mass*elapsedSeconds;
particle->Velocity = new Vector2(
particle->Velocity.X + particle->Velocity.X*drag,
particle->Velocity.Y + particle->Velocity.Y*drag);
}
}
}
}