public WaveDriver(IFluidSimulation simulation) { _simulation = simulation; for (int y = 0; y < _simulation.Height; ++y) { for (int x = 0; x < _simulation.Width; ++x) { _simulation.AddWater(x, y, 2.0f); } } _fixColumn0Height = true; }
public RiverDriver(IFluidSimulation simulation) { _simulation = simulation; for (int y = 0; y < _simulation.Height; ++y) { for (int x = 0; x < _simulation.Width; ++x) { if ((y < _simulation.Height / 3 && x < _simulation.Width * 5 / 8) || (y > _simulation.Height * 2 / 3) || (x > _simulation.Width * 7 / 8) || ((x > _simulation.Width * 5 / 8 && y > _simulation.Height / 3 && Mathf.Pow(((float)x / _simulation.Width - 5.0f / 8) * 4, 2) + Mathf.Pow(((float)y / _simulation.Height - 1.0f / 3) * 3, 2) > 1)) || (x > _simulation.Width * 24 / 32 && x < _simulation.Width * 25 / 32 && y > _simulation.Height * 2 / 16 && y < _simulation.Height * 4 / 16)) { _simulation.AddWater(x, y, 2.0f); _simulation.SetSolid(x, y, true); } } } }