コード例 #1
0
ファイル: ssBVH_Node.cs プロジェクト: tbg10101/SimpleScene
        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;
                }
            }
        }