protected override void AddParticleDirectly(Particle part) { base.AddParticleDirectly(part); Coordinate3D coord = TransformToCoord(part.Position); ParticleMap.Add(part, coord); GetCell(coord).AddParticle(part); }
protected override void AddParticleDirectly(Particle part) { base.AddParticleDirectly(part); Coord3D coord = TransformToCoord(part.Position); ParticleMap.Add(part, coord); Grid[coord].AddLast(part); }
public GameMap(int width, int height) { this.width = width; this.height = height; partMap = new ParticleMap(this, width, height); tempMap = new TemperatureMap(this, width, height); /* fluidMap = new FluidMap(this, width, height); */ }
protected override void RemoveParticleDirectly(Particle part) { base.RemoveParticleDirectly(part); if (ParticleMap.ContainsKey(part)) { Coordinate3D coord = ParticleMap[part]; GetCell(coord).RemoveParticle(part); ParticleMap.Remove(part); } }
protected override void RemoveParticleDirectly(Particle part) { base.RemoveParticleDirectly(part); if (ParticleMap.ContainsKey(part)) { Coord3D coord = ParticleMap[part]; Grid[coord].Remove(part); ParticleMap.Remove(part); } }
public static void ApplyPhysics(ParticleMap input, GameTime GameTime) { foreach (Particle Particle in input.Particles) { if (GravityEnabled) { Gravity.ApplyGravity(Particle); } Particle.Update(GameTime); } }