Example #1
0
        public FluidSim(int width, int height, float scale)
        {
            Scale = 0.5f;
            GWidth = (int)(width / scale) + 1;
            GHeight = (int)(height / scale) + 1;

            Grid = new GridCell[GHeight, GWidth];

            GridCoeff = 1f;
            GravityX = 0f;
            GravityY = (9.81f / 0.5f) * (1f / 900f);

            SDF = new DistanceField();
            SDF.Create(256, GWidth, GHeight);

            SDF.SubRect(0, 0, 128, 128);
            SDF.AddCircle(64, 128, 10);

            SDF.Blur();
        }