Ejemplo n.º 1
0
        public PressureGrid(Engine.Surface.Canvas c, int gridCellWidth, int gridCellHeight, bool invertLuminance)
        {
            t_imageSource = c;

            t_gridCellWidth  = gridCellWidth;
            t_gridCellHeight = gridCellHeight;

            t_flowField = new Effects.Particles.FlowField(t_imageSource, invertLuminance);

            SetGrid();
        }
Ejemplo n.º 2
0
        public void CalculateAveragePressure(Engine.Effects.Particles.FlowField flowField, int startX, int startY)
        {
            t_pressure = new Calc.Vector(0, 0);

            for (int y = 0; y < t_height; y++)
            {
                for (int x = 0; x < t_width; x++)
                {
                    Engine.Calc.Vector v = flowField.GetVector(x + startX, y + startY);
                    t_pressure += v;
                }
            }

            //t_pressure.Normalize(Calc.CalculationStyles.Accord);
        }