示例#1
0
            //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);
            }
示例#2
0
 public bool IsShapeOverlapTreeRect(ShapeObject shape)
 {
     return(QuadTreeRect.RectOverlap(TreeRect, shape.ShapeToRect));
 }