internal void RemoveObject(SSBVHNodeAdaptor <GO> nAda, GO newOb) { if (ContainedObjects == null) { throw new Exception("removeObject() called on nonLeaf!"); } nAda.UnmapObject(newOb); ContainedObjects.Remove(newOb); if (ContainedObjects.Count > 0) { RefitVolume(nAda); } else { // our leaf is empty, so collapse it if we are not the root... if (Parent != null) { ContainedObjects = null; Parent.RemoveLeaf(nAda, this); Parent = null; } } }