Particle system improvements:

- particles can collide with the outer walls of the sub
- drag + waterdrag parameters
- fixed particles "twitching" when the submarine is moving fast
- submarine velocity only affects the initial velocity of the particles (i.e. accelerating the sub doesn't automatically accelerate them)
This commit is contained in:
Regalis
2016-09-21 19:45:20 +03:00
parent b01b52172a
commit 721f4ff5a6
10 changed files with 230 additions and 68 deletions

View File

@@ -113,6 +113,14 @@ namespace Barotrauma.Particles
}
}
public void UpdateTransforms()
{
for (int i = 0; i < particleCount; i++)
{
particles[i].UpdateDrawPos();
}
}
public void Draw(SpriteBatch spriteBatch, bool inWater, ParticleBlendState blendState)
{
ParticlePrefab.DrawTargetType drawTarget = inWater ? ParticlePrefab.DrawTargetType.Water : ParticlePrefab.DrawTargetType.Air;