static public bool CouldContain(this RectF2 item, RectF2 target) { if (item.GetWidth() >= target.GetWidth()) { if (item.GetHeight() >= target.GetHeight()) { return(true); } } return(false); }
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))); } } }
static public bool IsCollapsed(this RectF2 item, float tolerance) { if (item.GetWidth() <= tolerance) { return(true); } if (item.GetHeight() <= tolerance) { return(true); } return(false); }
static public VectorF2 GetSize(this RectF2 item) { return(new VectorF2(item.GetWidth(), item.GetHeight())); }