示例#1
0
        public List <Node> FindNodesIntersectingRectangle(UVRect rectangle)
        {
            var nodes = new List <Node>();

            if (!Intersects(rectangle))
            {
                return(nodes);
            }

            if (IsLeafNode)
            {
                nodes.Add(this);
                return(nodes);
            }

            nodes.AddRange(NW.FindNodesIntersectingRectangle(rectangle));
            nodes.AddRange(NE.FindNodesIntersectingRectangle(rectangle));
            nodes.AddRange(SW.FindNodesIntersectingRectangle(rectangle));
            nodes.AddRange(SE.FindNodesIntersectingRectangle(rectangle));

            return(nodes);
        }