예제 #1
0
        public int AddProxy(ref AABB uaabb)
        {
            int  proxyId = _currId++;
            AABB aabb    = Fatten(ref uaabb);
            Element <FixtureProxy> qtnode = new Element <FixtureProxy>(aabb);

            _idRegister.Add(proxyId, qtnode);
            _quadTree.AddNode(qtnode);

            return(proxyId);
        }
예제 #2
0
 private void ReconstructTree()
 {
     //this is faster than _quadTree.Reconstruct(), since the quadtree method runs a recusive query to find all nodes.
     QuadTree.Clear();
     foreach (Element <FixtureProxy> elem in _idRegister.Values)
     {
         QuadTree.AddNode(elem);
     }
 }
예제 #3
0
        private void ReinsertNode(Element <FixtureProxy> qtnode)
        {
            QuadTree.RemoveNode(qtnode);
            QuadTree.AddNode(qtnode);

            if (++_treeMoveNum > TreeUpdateThresh)
            {
                ReconstructTree();
                _treeMoveNum = 0;
            }
        }
예제 #4
0
        public int AddProxy(ref FixtureProxy proxy)
        {
            int proxyId = _currId++;

            proxy.ProxyId = proxyId;
            AABB aabb = Fatten(ref proxy.AABB);
            Element <FixtureProxy> qtnode = new Element <FixtureProxy>(proxy, aabb);

            _idRegister.Add(proxyId, qtnode);
            QuadTree.AddNode(qtnode);

            return(proxyId);
        }