Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 8, 2009, 12:58:47 AM (16 years ago)
Author:
dafrick
Message:

Reverted to revision 2906 (because I'm too stupid to merge correctly, 2nd try will follow shortly. ;))

Location:
code/branches/questsystem5
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/questsystem5

  • code/branches/questsystem5/src/bullet/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp

    r2907 r2908  
    2020#include "btDispatcher.h"
    2121#include "btCollisionAlgorithm.h"
    22 #include "LinearMath/btAabbUtil2.h"
    2322
    2423#include <stdio.h>
     
    137136{
    138137        gFindPairs++;
    139         if(proxy0->m_uniqueId>proxy1->m_uniqueId)
    140                 btSwap(proxy0,proxy1);
     138        if(proxy0>proxy1) btSwap(proxy0,proxy1);
    141139        int proxyId1 = proxy0->getUid();
    142140        int proxyId2 = proxy1->getUid();
     
    214212btBroadphasePair* btHashedOverlappingPairCache::internalAddPair(btBroadphaseProxy* proxy0, btBroadphaseProxy* proxy1)
    215213{
    216         if(proxy0->m_uniqueId>proxy1->m_uniqueId)
    217                 btSwap(proxy0,proxy1);
     214        if(proxy0>proxy1) btSwap(proxy0,proxy1);
    218215        int proxyId1 = proxy0->getUid();
    219216        int proxyId2 = proxy1->getUid();
     
    274271{
    275272        gRemovePairs++;
    276         if(proxy0->m_uniqueId>proxy1->m_uniqueId)
    277                 btSwap(proxy0,proxy1);
     273        if(proxy0>proxy1) btSwap(proxy0,proxy1);
    278274        int proxyId1 = proxy0->getUid();
    279275        int proxyId2 = proxy1->getUid();
     
    397393}
    398394
    399 void    btHashedOverlappingPairCache::sortOverlappingPairs(btDispatcher* dispatcher)
    400 {
    401         ///need to keep hashmap in sync with pair address, so rebuild all
    402         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 }
    428395
    429396
     
    463430{
    464431        //don't add overlap with own
    465         btAssert(proxy0 != proxy1);
     432        assert(proxy0 != proxy1);
    466433
    467434        if (!needsBroadphaseCollision(proxy0,proxy1))
     
    494461        if (findIndex < m_overlappingPairArray.size())
    495462        {
    496                 //btAssert(it != m_overlappingPairSet.end());
     463                //assert(it != m_overlappingPairSet.end());
    497464                 btBroadphasePair* pair = &m_overlappingPairArray[findIndex];
    498465                return pair;
     
    524491                {
    525492                        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);
    529495                        m_overlappingPairArray.pop_back();
    530496                        gOverlappingPairs--;
     
    626592        processAllOverlappingPairs(&removeCallback,dispatcher);
    627593}
    628 
    629 void    btSortedOverlappingPairCache::sortOverlappingPairs(btDispatcher* dispatcher)
    630 {
    631         //should already be sorted
    632 }
    633 
Note: See TracChangeset for help on using the changeset viewer.