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