Exemple #1
0
        internal void GetAllObjects(ref List <T> results)
        {
            // If this Quad has objects, add them
            if (objects != null)
            {
                foreach (QuadTreeObject <T> qto in objects)
                {
                    results.Add(qto.Data);
                }
            }

            // If we have children, get their objects too
            if (childTL != null)
            {
                childTL.GetAllObjects(ref results);
                childTR.GetAllObjects(ref results);
                childBL.GetAllObjects(ref results);
                childBR.GetAllObjects(ref results);
            }
        }