Exemplo n.º 1
0
        public void SubDivide()
        {
            NodeTL = new QuadTree(Position - Size / 4, Size / 4);
            NodeBR = new QuadTree(Position + Size / 4, Size / 4);
            NodeTR = new QuadTree(Position + new Vector2(-Size.X / 4, Size.Y / 4), Size / 4);
            NodeTR = new QuadTree(Position + new Vector2(Size.X / 4, -Size.Y / 4), Size / 4);
            childNodes = new List<QuadTree>()
            {
                NodeTL, NodeTR, NodeBL, NodeBR
            };

            Distribute();
            Objects.Clear();
        }
Exemplo n.º 2
0
 public void ClearNode(QuadTree node)
 {
     if (node!=null)
     {
         node.Clear();
         node = null;
     }
 }