public void LoadContent() { if (content == null) { content = new ContentManager(fluidSimulation1.Services, "Content"); } GlassBox glassBox = new GlassBox(); glassBox.LoadContent(content); Fluid = new Fluid(2000, glassBox); Fluid.ActiveParticles = 500; surfaceTensionSlider = new Slider("Surface Tension: ", 0, 100, Fluid.SurfaceTension, 2); surfaceTensionSlider.OnValueChanged += new EventHandler(surfaceTensionSlider_OnValueChanged); surfaceTensionSlider.Length = 200; viscositySlider = new Slider("Viscosity: ", 0, 100, Fluid.Viscosity, 2); viscositySlider.OnValueChanged += new EventHandler(viscositySlider_OnValueChanged); viscositySlider.Length = 200; massSlider = new Slider("Particle Mass: ", 1, 20, Fluid.ParticleMass, 2); massSlider.OnValueChanged += new EventHandler(massSlider_OnValueChanged); massSlider.Length = 200; particlesSlider = new Slider("Particles: ", 1, Fluid.MaxParticles, Fluid.ActiveParticles, 0); particlesSlider.OnValueChanged += new EventHandler(particlesSlider_OnValueChanged); particlesSlider.Length = 200; timestepSlider = new Slider("Timestep: ", 1, 5, 1, 2); timestepSlider.OnValueChanged += new EventHandler(timestepSlider_OnValueChanged); timestepSlider.Length = 200; rotationSpeedSlider = new Slider("Rotation speed: ", -0.025f, 0.025f, rotationSpeed, 3); rotationSpeedSlider.OnValueChanged += new EventHandler(rotationSpeedSlider_OnValueChanged); rotationSpeedSlider.Length = 200; guiElements = new StackPanel(40); guiElements.Add(surfaceTensionSlider); guiElements.Add(viscositySlider); guiElements.Add(massSlider); guiElements.Add(particlesSlider); guiElements.Add(timestepSlider); guiElements.Add(rotationSpeedSlider); restartButton = new Button("Restart", FluidSimulation1.Font); restartButton.OnClick += new EventHandler(restartButton_OnClick); guiElements.Add(restartButton); debugGrid = new DebugGrid(fluidSimulation1.GraphicsDevice); guiElements.Font = FluidSimulation1.Font; guiElements.LoadContent(content); fluidRenderer = new FluidRendererMarchingCubes(Fluid, fluidSimulation1.GraphicsDevice); marchingCubesEffect = new BasicEffect(fluidSimulation1.GraphicsDevice); }