Changeset 2908 for code/branches/questsystem5/src/bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
- Timestamp:
- Apr 8, 2009, 12:58:47 AM (16 years ago)
- Location:
- code/branches/questsystem5
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/questsystem5
- Property svn:mergeinfo changed
-
code/branches/questsystem5/src/bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp
r2907 r2908 20 20 #include "btDispatcher.h" 21 21 #include "btCollisionAlgorithm.h" 22 #include "LinearMath/btAabbUtil2.h"23 22 24 23 #include <stdio.h> … … 137 136 { 138 137 gFindPairs++; 139 if(proxy0->m_uniqueId>proxy1->m_uniqueId) 140 btSwap(proxy0,proxy1); 138 if(proxy0>proxy1) btSwap(proxy0,proxy1); 141 139 int proxyId1 = proxy0->getUid(); 142 140 int proxyId2 = proxy1->getUid(); … … 214 212 btBroadphasePair* btHashedOverlappingPairCache::internalAddPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1) 215 213 { 216 if(proxy0->m_uniqueId>proxy1->m_uniqueId) 217 btSwap(proxy0,proxy1); 214 if(proxy0>proxy1) btSwap(proxy0,proxy1); 218 215 int proxyId1 = proxy0->getUid(); 219 216 int proxyId2 = proxy1->getUid(); … … 274 271 { 275 272 gRemovePairs++; 276 if(proxy0->m_uniqueId>proxy1->m_uniqueId) 277 btSwap(proxy0,proxy1); 273 if(proxy0>proxy1) btSwap(proxy0,proxy1); 278 274 int proxyId1 = proxy0->getUid(); 279 275 int proxyId2 = proxy1->getUid(); … … 397 393 } 398 394 399 void btHashedOverlappingPairCache::sortOverlappingPairs(btDispatcher* dispatcher)400 {401 ///need to keep hashmap in sync with pair address, so rebuild all402 btBroadphasePairArray tmpPairs;403 int i;404 for (i=0;i<m_overlappingPairArray.size();i++)405 {406 tmpPairs.push_back(m_overlappingPairArray[i]);407 }408 409 for (i=0;i<tmpPairs.size();i++)410 {411 removeOverlappingPair(tmpPairs[i].m_pProxy0,tmpPairs[i].m_pProxy1,dispatcher);412 }413 414 for (i = 0; i < m_next.size(); i++)415 {416 m_next[i] = BT_NULL_PAIR;417 }418 419 tmpPairs.quickSort(btBroadphasePairSortPredicate());420 421 for (i=0;i<tmpPairs.size();i++)422 {423 addOverlappingPair(tmpPairs[i].m_pProxy0,tmpPairs[i].m_pProxy1);424 }425 426 427 }428 395 429 396 … … 463 430 { 464 431 //don't add overlap with own 465 btAssert(proxy0 != proxy1);432 assert(proxy0 != proxy1); 466 433 467 434 if (!needsBroadphaseCollision(proxy0,proxy1)) … … 494 461 if (findIndex < m_overlappingPairArray.size()) 495 462 { 496 // btAssert(it != m_overlappingPairSet.end());463 //assert(it != m_overlappingPairSet.end()); 497 464 btBroadphasePair* pair = &m_overlappingPairArray[findIndex]; 498 465 return pair; … … 524 491 { 525 492 cleanOverlappingPair(*pair,dispatcher); 526 pair->m_pProxy0 = 0; 527 pair->m_pProxy1 = 0; 528 m_overlappingPairArray.swap(i,m_overlappingPairArray.size()-1); 493 494 m_overlappingPairArray.swap(i,m_overlappingPairArray.capacity()-1); 529 495 m_overlappingPairArray.pop_back(); 530 496 gOverlappingPairs--; … … 626 592 processAllOverlappingPairs(&removeCallback,dispatcher); 627 593 } 628 629 void btSortedOverlappingPairCache::sortOverlappingPairs(btDispatcher* dispatcher)630 {631 //should already be sorted632 }633
Note: See TracChangeset
for help on using the changeset viewer.