btOverlappingPairCache.cpp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. /*
  2. Bullet Continuous Collision Detection and Physics Library
  3. Copyright (c) 2003-2006 Erwin Coumans https://bulletphysics.org
  4. This software is provided 'as-is', without any express or implied warranty.
  5. In no event will the authors be held liable for any damages arising from the use of this software.
  6. Permission is granted to anyone to use this software for any purpose,
  7. including commercial applications, and to alter it and redistribute it freely,
  8. subject to the following restrictions:
  9. 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  10. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  11. 3. This notice may not be removed or altered from any source distribution.
  12. */
  13. #include "btOverlappingPairCache.h"
  14. #include "btDispatcher.h"
  15. #include "btCollisionAlgorithm.h"
  16. #include "LinearMath/btAabbUtil2.h"
  17. #include <stdio.h>
  18. btHashedOverlappingPairCache::btHashedOverlappingPairCache() : m_overlapFilterCallback(0),
  19. m_ghostPairCallback(0)
  20. {
  21. int initialAllocatedSize = 2;
  22. m_overlappingPairArray.reserve(initialAllocatedSize);
  23. growTables();
  24. }
  25. btHashedOverlappingPairCache::~btHashedOverlappingPairCache()
  26. {
  27. }
  28. void btHashedOverlappingPairCache::cleanOverlappingPair(btBroadphasePair& pair, btDispatcher* dispatcher)
  29. {
  30. if (pair.m_algorithm && dispatcher)
  31. {
  32. {
  33. pair.m_algorithm->~btCollisionAlgorithm();
  34. dispatcher->freeCollisionAlgorithm(pair.m_algorithm);
  35. pair.m_algorithm = 0;
  36. }
  37. }
  38. }
  39. void btHashedOverlappingPairCache::cleanProxyFromPairs(btBroadphaseProxy* proxy, btDispatcher* dispatcher)
  40. {
  41. class CleanPairCallback : public btOverlapCallback
  42. {
  43. btBroadphaseProxy* m_cleanProxy;
  44. btOverlappingPairCache* m_pairCache;
  45. btDispatcher* m_dispatcher;
  46. public:
  47. CleanPairCallback(btBroadphaseProxy* cleanProxy, btOverlappingPairCache* pairCache, btDispatcher* dispatcher)
  48. : m_cleanProxy(cleanProxy),
  49. m_pairCache(pairCache),
  50. m_dispatcher(dispatcher)
  51. {
  52. }
  53. virtual bool processOverlap(btBroadphasePair& pair)
  54. {
  55. if ((pair.m_pProxy0 == m_cleanProxy) ||
  56. (pair.m_pProxy1 == m_cleanProxy))
  57. {
  58. m_pairCache->cleanOverlappingPair(pair, m_dispatcher);
  59. }
  60. return false;
  61. }
  62. };
  63. CleanPairCallback cleanPairs(proxy, this, dispatcher);
  64. processAllOverlappingPairs(&cleanPairs, dispatcher);
  65. }
  66. void btHashedOverlappingPairCache::removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy, btDispatcher* dispatcher)
  67. {
  68. class RemovePairCallback : public btOverlapCallback
  69. {
  70. btBroadphaseProxy* m_obsoleteProxy;
  71. public:
  72. RemovePairCallback(btBroadphaseProxy* obsoleteProxy)
  73. : m_obsoleteProxy(obsoleteProxy)
  74. {
  75. }
  76. virtual bool processOverlap(btBroadphasePair& pair)
  77. {
  78. return ((pair.m_pProxy0 == m_obsoleteProxy) ||
  79. (pair.m_pProxy1 == m_obsoleteProxy));
  80. }
  81. };
  82. RemovePairCallback removeCallback(proxy);
  83. processAllOverlappingPairs(&removeCallback, dispatcher);
  84. }
  85. btBroadphasePair* btHashedOverlappingPairCache::findPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1)
  86. {
  87. if (proxy0->m_uniqueId > proxy1->m_uniqueId)
  88. btSwap(proxy0, proxy1);
  89. int proxyId1 = proxy0->getUid();
  90. int proxyId2 = proxy1->getUid();
  91. /*if (proxyId1 > proxyId2)
  92. btSwap(proxyId1, proxyId2);*/
  93. int hash = static_cast<int>(getHash(static_cast<unsigned int>(proxyId1), static_cast<unsigned int>(proxyId2)) & (m_overlappingPairArray.capacity() - 1));
  94. if (hash >= m_hashTable.size())
  95. {
  96. return NULL;
  97. }
  98. int index = m_hashTable[hash];
  99. while (index != BT_NULL_PAIR && equalsPair(m_overlappingPairArray[index], proxyId1, proxyId2) == false)
  100. {
  101. index = m_next[index];
  102. }
  103. if (index == BT_NULL_PAIR)
  104. {
  105. return NULL;
  106. }
  107. btAssert(index < m_overlappingPairArray.size());
  108. return &m_overlappingPairArray[index];
  109. }
  110. //#include <stdio.h>
  111. void btHashedOverlappingPairCache::growTables()
  112. {
  113. int newCapacity = m_overlappingPairArray.capacity();
  114. if (m_hashTable.size() < newCapacity)
  115. {
  116. //grow hashtable and next table
  117. int curHashtableSize = m_hashTable.size();
  118. m_hashTable.resize(newCapacity);
  119. m_next.resize(newCapacity);
  120. int i;
  121. for (i = 0; i < newCapacity; ++i)
  122. {
  123. m_hashTable[i] = BT_NULL_PAIR;
  124. }
  125. for (i = 0; i < newCapacity; ++i)
  126. {
  127. m_next[i] = BT_NULL_PAIR;
  128. }
  129. for (i = 0; i < curHashtableSize; i++)
  130. {
  131. const btBroadphasePair& pair = m_overlappingPairArray[i];
  132. int proxyId1 = pair.m_pProxy0->getUid();
  133. int proxyId2 = pair.m_pProxy1->getUid();
  134. /*if (proxyId1 > proxyId2)
  135. btSwap(proxyId1, proxyId2);*/
  136. int hashValue = static_cast<int>(getHash(static_cast<unsigned int>(proxyId1), static_cast<unsigned int>(proxyId2)) & (m_overlappingPairArray.capacity() - 1)); // New hash value with new mask
  137. m_next[i] = m_hashTable[hashValue];
  138. m_hashTable[hashValue] = i;
  139. }
  140. }
  141. }
  142. btBroadphasePair* btHashedOverlappingPairCache::internalAddPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1)
  143. {
  144. if (proxy0->m_uniqueId > proxy1->m_uniqueId)
  145. btSwap(proxy0, proxy1);
  146. int proxyId1 = proxy0->getUid();
  147. int proxyId2 = proxy1->getUid();
  148. /*if (proxyId1 > proxyId2)
  149. btSwap(proxyId1, proxyId2);*/
  150. int hash = static_cast<int>(getHash(static_cast<unsigned int>(proxyId1), static_cast<unsigned int>(proxyId2)) & (m_overlappingPairArray.capacity() - 1)); // New hash value with new mask
  151. btBroadphasePair* pair = internalFindPair(proxy0, proxy1, hash);
  152. if (pair != NULL)
  153. {
  154. return pair;
  155. }
  156. /*for(int i=0;i<m_overlappingPairArray.size();++i)
  157. {
  158. if( (m_overlappingPairArray[i].m_pProxy0==proxy0)&&
  159. (m_overlappingPairArray[i].m_pProxy1==proxy1))
  160. {
  161. printf("Adding duplicated %u<>%u\r\n",proxyId1,proxyId2);
  162. internalFindPair(proxy0, proxy1, hash);
  163. }
  164. }*/
  165. int count = m_overlappingPairArray.size();
  166. int oldCapacity = m_overlappingPairArray.capacity();
  167. void* mem = &m_overlappingPairArray.expandNonInitializing();
  168. //this is where we add an actual pair, so also call the 'ghost'
  169. if (m_ghostPairCallback)
  170. m_ghostPairCallback->addOverlappingPair(proxy0, proxy1);
  171. int newCapacity = m_overlappingPairArray.capacity();
  172. if (oldCapacity < newCapacity)
  173. {
  174. growTables();
  175. //hash with new capacity
  176. hash = static_cast<int>(getHash(static_cast<unsigned int>(proxyId1), static_cast<unsigned int>(proxyId2)) & (m_overlappingPairArray.capacity() - 1));
  177. }
  178. pair = new (mem) btBroadphasePair(*proxy0, *proxy1);
  179. // pair->m_pProxy0 = proxy0;
  180. // pair->m_pProxy1 = proxy1;
  181. pair->m_algorithm = 0;
  182. pair->m_internalTmpValue = 0;
  183. m_next[count] = m_hashTable[hash];
  184. m_hashTable[hash] = count;
  185. return pair;
  186. }
  187. void* btHashedOverlappingPairCache::removeOverlappingPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1, btDispatcher* dispatcher)
  188. {
  189. if (proxy0->m_uniqueId > proxy1->m_uniqueId)
  190. btSwap(proxy0, proxy1);
  191. int proxyId1 = proxy0->getUid();
  192. int proxyId2 = proxy1->getUid();
  193. /*if (proxyId1 > proxyId2)
  194. btSwap(proxyId1, proxyId2);*/
  195. int hash = static_cast<int>(getHash(static_cast<unsigned int>(proxyId1), static_cast<unsigned int>(proxyId2)) & (m_overlappingPairArray.capacity() - 1));
  196. btBroadphasePair* pair = internalFindPair(proxy0, proxy1, hash);
  197. if (pair == NULL)
  198. {
  199. return 0;
  200. }
  201. cleanOverlappingPair(*pair, dispatcher);
  202. void* userData = pair->m_internalInfo1;
  203. btAssert(pair->m_pProxy0->getUid() == proxyId1);
  204. btAssert(pair->m_pProxy1->getUid() == proxyId2);
  205. int pairIndex = int(pair - &m_overlappingPairArray[0]);
  206. btAssert(pairIndex < m_overlappingPairArray.size());
  207. // Remove the pair from the hash table.
  208. int index = m_hashTable[hash];
  209. btAssert(index != BT_NULL_PAIR);
  210. int previous = BT_NULL_PAIR;
  211. while (index != pairIndex)
  212. {
  213. previous = index;
  214. index = m_next[index];
  215. }
  216. if (previous != BT_NULL_PAIR)
  217. {
  218. btAssert(m_next[previous] == pairIndex);
  219. m_next[previous] = m_next[pairIndex];
  220. }
  221. else
  222. {
  223. m_hashTable[hash] = m_next[pairIndex];
  224. }
  225. // We now move the last pair into spot of the
  226. // pair being removed. We need to fix the hash
  227. // table indices to support the move.
  228. int lastPairIndex = m_overlappingPairArray.size() - 1;
  229. if (m_ghostPairCallback)
  230. m_ghostPairCallback->removeOverlappingPair(proxy0, proxy1, dispatcher);
  231. // If the removed pair is the last pair, we are done.
  232. if (lastPairIndex == pairIndex)
  233. {
  234. m_overlappingPairArray.pop_back();
  235. return userData;
  236. }
  237. // Remove the last pair from the hash table.
  238. const btBroadphasePair* last = &m_overlappingPairArray[lastPairIndex];
  239. /* missing swap here too, Nat. */
  240. int lastHash = static_cast<int>(getHash(static_cast<unsigned int>(last->m_pProxy0->getUid()), static_cast<unsigned int>(last->m_pProxy1->getUid())) & (m_overlappingPairArray.capacity() - 1));
  241. index = m_hashTable[lastHash];
  242. btAssert(index != BT_NULL_PAIR);
  243. previous = BT_NULL_PAIR;
  244. while (index != lastPairIndex)
  245. {
  246. previous = index;
  247. index = m_next[index];
  248. }
  249. if (previous != BT_NULL_PAIR)
  250. {
  251. btAssert(m_next[previous] == lastPairIndex);
  252. m_next[previous] = m_next[lastPairIndex];
  253. }
  254. else
  255. {
  256. m_hashTable[lastHash] = m_next[lastPairIndex];
  257. }
  258. // Copy the last pair into the remove pair's spot.
  259. m_overlappingPairArray[pairIndex] = m_overlappingPairArray[lastPairIndex];
  260. // Insert the last pair into the hash table
  261. m_next[pairIndex] = m_hashTable[lastHash];
  262. m_hashTable[lastHash] = pairIndex;
  263. m_overlappingPairArray.pop_back();
  264. return userData;
  265. }
  266. //#include <stdio.h>
  267. #include "LinearMath/btQuickprof.h"
  268. void btHashedOverlappingPairCache::processAllOverlappingPairs(btOverlapCallback* callback, btDispatcher* dispatcher)
  269. {
  270. BT_PROFILE("btHashedOverlappingPairCache::processAllOverlappingPairs");
  271. int i;
  272. // printf("m_overlappingPairArray.size()=%d\n",m_overlappingPairArray.size());
  273. for (i = 0; i < m_overlappingPairArray.size();)
  274. {
  275. btBroadphasePair* pair = &m_overlappingPairArray[i];
  276. if (callback->processOverlap(*pair))
  277. {
  278. removeOverlappingPair(pair->m_pProxy0, pair->m_pProxy1, dispatcher);
  279. }
  280. else
  281. {
  282. i++;
  283. }
  284. }
  285. }
  286. struct MyPairIndex
  287. {
  288. int m_orgIndex;
  289. int m_uidA0;
  290. int m_uidA1;
  291. };
  292. class MyPairIndeSortPredicate
  293. {
  294. public:
  295. bool operator()(const MyPairIndex& a, const MyPairIndex& b) const
  296. {
  297. const int uidA0 = a.m_uidA0;
  298. const int uidB0 = b.m_uidA0;
  299. const int uidA1 = a.m_uidA1;
  300. const int uidB1 = b.m_uidA1;
  301. return uidA0 > uidB0 || (uidA0 == uidB0 && uidA1 > uidB1);
  302. }
  303. };
  304. void btHashedOverlappingPairCache::processAllOverlappingPairs(btOverlapCallback* callback, btDispatcher* dispatcher, const struct btDispatcherInfo& dispatchInfo)
  305. {
  306. if (dispatchInfo.m_deterministicOverlappingPairs)
  307. {
  308. btBroadphasePairArray& pa = getOverlappingPairArray();
  309. btAlignedObjectArray<MyPairIndex> indices;
  310. {
  311. BT_PROFILE("sortOverlappingPairs");
  312. indices.resize(pa.size());
  313. for (int i = 0; i < indices.size(); i++)
  314. {
  315. const btBroadphasePair& p = pa[i];
  316. const int uidA0 = p.m_pProxy0 ? p.m_pProxy0->m_uniqueId : -1;
  317. const int uidA1 = p.m_pProxy1 ? p.m_pProxy1->m_uniqueId : -1;
  318. indices[i].m_uidA0 = uidA0;
  319. indices[i].m_uidA1 = uidA1;
  320. indices[i].m_orgIndex = i;
  321. }
  322. indices.quickSort(MyPairIndeSortPredicate());
  323. }
  324. {
  325. BT_PROFILE("btHashedOverlappingPairCache::processAllOverlappingPairs");
  326. int i;
  327. for (i = 0; i < indices.size();)
  328. {
  329. btBroadphasePair* pair = &pa[indices[i].m_orgIndex];
  330. if (callback->processOverlap(*pair))
  331. {
  332. removeOverlappingPair(pair->m_pProxy0, pair->m_pProxy1, dispatcher);
  333. }
  334. else
  335. {
  336. i++;
  337. }
  338. }
  339. }
  340. }
  341. else
  342. {
  343. processAllOverlappingPairs(callback, dispatcher);
  344. }
  345. }
  346. void btHashedOverlappingPairCache::sortOverlappingPairs(btDispatcher* dispatcher)
  347. {
  348. ///need to keep hashmap in sync with pair address, so rebuild all
  349. btBroadphasePairArray tmpPairs;
  350. int i;
  351. for (i = 0; i < m_overlappingPairArray.size(); i++)
  352. {
  353. tmpPairs.push_back(m_overlappingPairArray[i]);
  354. }
  355. for (i = 0; i < tmpPairs.size(); i++)
  356. {
  357. removeOverlappingPair(tmpPairs[i].m_pProxy0, tmpPairs[i].m_pProxy1, dispatcher);
  358. }
  359. for (i = 0; i < m_next.size(); i++)
  360. {
  361. m_next[i] = BT_NULL_PAIR;
  362. }
  363. tmpPairs.quickSort(btBroadphasePairSortPredicate());
  364. for (i = 0; i < tmpPairs.size(); i++)
  365. {
  366. addOverlappingPair(tmpPairs[i].m_pProxy0, tmpPairs[i].m_pProxy1);
  367. }
  368. }
  369. void* btSortedOverlappingPairCache::removeOverlappingPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1, btDispatcher* dispatcher)
  370. {
  371. if (!hasDeferredRemoval())
  372. {
  373. btBroadphasePair findPair(*proxy0, *proxy1);
  374. int findIndex = m_overlappingPairArray.findLinearSearch(findPair);
  375. if (findIndex < m_overlappingPairArray.size())
  376. {
  377. btBroadphasePair& pair = m_overlappingPairArray[findIndex];
  378. void* userData = pair.m_internalInfo1;
  379. cleanOverlappingPair(pair, dispatcher);
  380. if (m_ghostPairCallback)
  381. m_ghostPairCallback->removeOverlappingPair(proxy0, proxy1, dispatcher);
  382. m_overlappingPairArray.swap(findIndex, m_overlappingPairArray.capacity() - 1);
  383. m_overlappingPairArray.pop_back();
  384. return userData;
  385. }
  386. }
  387. return 0;
  388. }
  389. btBroadphasePair* btSortedOverlappingPairCache::addOverlappingPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1)
  390. {
  391. //don't add overlap with own
  392. btAssert(proxy0 != proxy1);
  393. if (!needsBroadphaseCollision(proxy0, proxy1))
  394. return 0;
  395. void* mem = &m_overlappingPairArray.expandNonInitializing();
  396. btBroadphasePair* pair = new (mem) btBroadphasePair(*proxy0, *proxy1);
  397. if (m_ghostPairCallback)
  398. m_ghostPairCallback->addOverlappingPair(proxy0, proxy1);
  399. return pair;
  400. }
  401. ///this findPair becomes really slow. Either sort the list to speedup the query, or
  402. ///use a different solution. It is mainly used for Removing overlapping pairs. Removal could be delayed.
  403. ///we could keep a linked list in each proxy, and store pair in one of the proxies (with lowest memory address)
  404. ///Also we can use a 2D bitmap, which can be useful for a future GPU implementation
  405. btBroadphasePair* btSortedOverlappingPairCache::findPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1)
  406. {
  407. if (!needsBroadphaseCollision(proxy0, proxy1))
  408. return 0;
  409. btBroadphasePair tmpPair(*proxy0, *proxy1);
  410. int findIndex = m_overlappingPairArray.findLinearSearch(tmpPair);
  411. if (findIndex < m_overlappingPairArray.size())
  412. {
  413. //btAssert(it != m_overlappingPairSet.end());
  414. btBroadphasePair* pair = &m_overlappingPairArray[findIndex];
  415. return pair;
  416. }
  417. return 0;
  418. }
  419. //#include <stdio.h>
  420. void btSortedOverlappingPairCache::processAllOverlappingPairs(btOverlapCallback* callback, btDispatcher* dispatcher)
  421. {
  422. int i;
  423. for (i = 0; i < m_overlappingPairArray.size();)
  424. {
  425. btBroadphasePair* pair = &m_overlappingPairArray[i];
  426. if (callback->processOverlap(*pair))
  427. {
  428. cleanOverlappingPair(*pair, dispatcher);
  429. pair->m_pProxy0 = 0;
  430. pair->m_pProxy1 = 0;
  431. m_overlappingPairArray.swap(i, m_overlappingPairArray.size() - 1);
  432. m_overlappingPairArray.pop_back();
  433. }
  434. else
  435. {
  436. i++;
  437. }
  438. }
  439. }
  440. btSortedOverlappingPairCache::btSortedOverlappingPairCache() : m_blockedForChanges(false),
  441. m_hasDeferredRemoval(true),
  442. m_overlapFilterCallback(0),
  443. m_ghostPairCallback(0)
  444. {
  445. int initialAllocatedSize = 2;
  446. m_overlappingPairArray.reserve(initialAllocatedSize);
  447. }
  448. btSortedOverlappingPairCache::~btSortedOverlappingPairCache()
  449. {
  450. }
  451. void btSortedOverlappingPairCache::cleanOverlappingPair(btBroadphasePair& pair, btDispatcher* dispatcher)
  452. {
  453. if (pair.m_algorithm)
  454. {
  455. {
  456. pair.m_algorithm->~btCollisionAlgorithm();
  457. dispatcher->freeCollisionAlgorithm(pair.m_algorithm);
  458. pair.m_algorithm = 0;
  459. }
  460. }
  461. }
  462. void btSortedOverlappingPairCache::cleanProxyFromPairs(btBroadphaseProxy* proxy, btDispatcher* dispatcher)
  463. {
  464. class CleanPairCallback : public btOverlapCallback
  465. {
  466. btBroadphaseProxy* m_cleanProxy;
  467. btOverlappingPairCache* m_pairCache;
  468. btDispatcher* m_dispatcher;
  469. public:
  470. CleanPairCallback(btBroadphaseProxy* cleanProxy, btOverlappingPairCache* pairCache, btDispatcher* dispatcher)
  471. : m_cleanProxy(cleanProxy),
  472. m_pairCache(pairCache),
  473. m_dispatcher(dispatcher)
  474. {
  475. }
  476. virtual bool processOverlap(btBroadphasePair& pair)
  477. {
  478. if ((pair.m_pProxy0 == m_cleanProxy) ||
  479. (pair.m_pProxy1 == m_cleanProxy))
  480. {
  481. m_pairCache->cleanOverlappingPair(pair, m_dispatcher);
  482. }
  483. return false;
  484. }
  485. };
  486. CleanPairCallback cleanPairs(proxy, this, dispatcher);
  487. processAllOverlappingPairs(&cleanPairs, dispatcher);
  488. }
  489. void btSortedOverlappingPairCache::removeOverlappingPairsContainingProxy(btBroadphaseProxy* proxy, btDispatcher* dispatcher)
  490. {
  491. class RemovePairCallback : public btOverlapCallback
  492. {
  493. btBroadphaseProxy* m_obsoleteProxy;
  494. public:
  495. RemovePairCallback(btBroadphaseProxy* obsoleteProxy)
  496. : m_obsoleteProxy(obsoleteProxy)
  497. {
  498. }
  499. virtual bool processOverlap(btBroadphasePair& pair)
  500. {
  501. return ((pair.m_pProxy0 == m_obsoleteProxy) ||
  502. (pair.m_pProxy1 == m_obsoleteProxy));
  503. }
  504. };
  505. RemovePairCallback removeCallback(proxy);
  506. processAllOverlappingPairs(&removeCallback, dispatcher);
  507. }
  508. void btSortedOverlappingPairCache::sortOverlappingPairs(btDispatcher* dispatcher)
  509. {
  510. //should already be sorted
  511. }