예제 #1
0
 public void Clear()
 {
     if (IsReadonly)
     {
         throw new Exception("Someone was either stuck processing or didn't properly dispose of Enumerator for AABBTree.");
     }
     DynamicNodeLookup.Clear();
     StaticNodeLookup.Clear();
     Root = null;
 }
예제 #2
0
 public void Rebuild()
 {
     if (IsReadonly)
     {
         throw new Exception("Someone was either stuck processing or didn't properly dispose of Enumerator for AABBTree.");
     }
     DynamicNodeLookup.Clear();
     StaticNodeLookup.Clear();
     base.ReinitializeTreeFromRootItem();
 }
예제 #3
0
    public virtual void Insert(IDynamicObject input)
    {
        if (IsReadonly)
        {
            throw new Exception("Someone was either stuck processing or didn't properly dispose of Enumerator for AABBTree.");
        }
        ValueObserver <BoundingBox> Bounds = input.Bounds;
        IAABBNode myNewNode = new AABBDynamicDataNode(Bounds, this, input);

        DynamicNodeLookup.Add(input, myNewNode);
        Insert(myNewNode);
    }
예제 #4
0
    public bool Remove(IDynamicObject MyItem)
    {
        if (IsReadonly)
        {
            throw new Exception("Someone was either stuck processing or didn't properly dispose of Enumerator for AABBTree.");
        }
        IAABBNode NodeData;

        if (DynamicNodeLookup.TryGetValue((Object)MyItem, out NodeData))
        {
            base.RemoveNode(NodeData);
            DynamicNodeLookup.Remove((Object)MyItem);
            return(true);
        }
        else
        {
            return(false);
        }
    }