コード例 #1
0
        public SimpleBroadphase(int maxProxies, IOverlappingPairCache overlappingPairCache)
        {
            if (overlappingPairCache == null)
            {
                overlappingPairCache = new HashedOverlappingPairCache();
                m_ownsPairCache      = true;
            }
            m_pHandles        = new SimpleBroadphaseProxy[maxProxies];
            m_pairCache       = overlappingPairCache;
            m_maxHandles      = maxProxies;
            m_numHandles      = 0;
            m_firstFreeHandle = 0;
            m_LastHandleIndex = -1;

            for (int i = m_firstFreeHandle; i < maxProxies; i++)
            {
                m_pHandles[i] = new SimpleBroadphaseProxy(i);
                m_pHandles[i].SetNextFree(i + 1);
                m_pHandles[i].m_uniqueId = ++m_proxyCounter;; //any UID will do, we just avoid too trivial values (0,1) for debugging purposes
            }
            m_pHandles[maxProxies - 1].SetNextFree(0);
        }
コード例 #2
0
 public PairCachingGhostObject()
 {
     m_hashPairCache = new HashedOverlappingPairCache();
 }