//Take public List <ShapeObject> TakeShapesInRect(QuadTreeRect rect) { List <ShapeObject> takes = new List <ShapeObject>(); if (!QuadTreeRect.RectOverlap(TreeRect, rect)) { return(takes); } takes.AddRange(chiledShapes); if (chiledTrees == null) { return(takes); } for (int i = 0; i < chiledTrees.Length; i++) { takes.AddRange(chiledTrees[i].TakeShapesInRect(rect)); } return(takes); }
public bool IsShapeOverlapTreeRect(ShapeObject shape) { return(QuadTreeRect.RectOverlap(TreeRect, shape.ShapeToRect)); }