Exemplo n.º 1
0
        static public IEnumerable <Tuple <int, int, RectF2> > GetCroppedGridChunkInfos(this RectF2 item, VectorF2 cell_size)
        {
            int width_in_cells  = Mathq.CeilToInt(item.GetWidth() / cell_size.x);
            int height_in_cells = Mathq.CeilToInt(item.GetHeight() / cell_size.y);

            for (int y = 0; y < height_in_cells; y++)
            {
                for (int x = 0; x < width_in_cells; x++)
                {
                    yield return(Tuple.New(x, y, item.GetCroppedGridChunk(x, y, cell_size)));
                }
            }
        }