more broadphase/pair cache/MultiSAP improvements.
This commit is contained in:
@@ -464,7 +464,7 @@ template <typename BP_FP_INT_TYPE>
|
||||
void btAxisSweep3Internal<BP_FP_INT_TYPE>::calculateOverlappingPairs(btDispatcher* dispatcher)
|
||||
{
|
||||
|
||||
if (m_ownsPairCache && m_pairCache->hasDeferredRemoval())
|
||||
if (m_pairCache->hasDeferredRemoval())
|
||||
{
|
||||
|
||||
btBroadphasePairArray& overlappingPairArray = m_pairCache->getOverlappingPairArray();
|
||||
|
||||
@@ -64,6 +64,7 @@ btMultiSapBroadphase::~btMultiSapBroadphase()
|
||||
{
|
||||
if (m_ownsPairCache)
|
||||
{
|
||||
m_overlappingPairs->~btOverlappingPairCache();
|
||||
btAlignedFree(m_overlappingPairs);
|
||||
}
|
||||
}
|
||||
@@ -115,7 +116,9 @@ void btMultiSapBroadphase::calculateOverlappingPairs(btDispatcher* dispatcher)
|
||||
{
|
||||
m_simpleBroadphase->calculateOverlappingPairs(dispatcher);
|
||||
|
||||
#ifndef USE_HASH_PAIRCACHE
|
||||
if (m_overlappingPairs->hasDeferredRemoval())
|
||||
{
|
||||
|
||||
|
||||
btBroadphasePairArray& overlappingPairArray = m_overlappingPairs->getOverlappingPairArray();
|
||||
|
||||
@@ -177,18 +180,18 @@ void btMultiSapBroadphase::calculateOverlappingPairs(btDispatcher* dispatcher)
|
||||
|
||||
}
|
||||
|
||||
///if you don't like to skip the invalid pairs in the array, execute following code:
|
||||
#define CLEAN_INVALID_PAIRS 1
|
||||
#ifdef CLEAN_INVALID_PAIRS
|
||||
///if you don't like to skip the invalid pairs in the array, execute following code:
|
||||
#define CLEAN_INVALID_PAIRS 1
|
||||
#ifdef CLEAN_INVALID_PAIRS
|
||||
|
||||
//perform a sort, to sort 'invalid' pairs to the end
|
||||
overlappingPairArray.heapSort(btBroadphasePairSortPredicate());
|
||||
|
||||
overlappingPairArray.resize(overlappingPairArray.size() - m_invalidPair);
|
||||
m_invalidPair = 0;
|
||||
#endif//CLEAN_INVALID_PAIRS
|
||||
#endif//CLEAN_INVALID_PAIRS
|
||||
|
||||
#endif //USE_HASH_PAIRCACHE
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -204,12 +204,13 @@ void btSimpleBroadphase::calculateOverlappingPairs(btDispatcher* dispatcher)
|
||||
}
|
||||
} else
|
||||
{
|
||||
#ifdef USE_HASH_PAIRCACHE
|
||||
if (!m_pairCache->hasDeferredRemoval())
|
||||
{
|
||||
if ( m_pairCache->findPair(proxy0,proxy1))
|
||||
{
|
||||
m_pairCache->removeOverlappingPair(proxy0,proxy1,dispatcher);
|
||||
}
|
||||
#endif //USE_HASH_PAIRCACHE
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -220,9 +221,7 @@ void btSimpleBroadphase::calculateOverlappingPairs(btDispatcher* dispatcher)
|
||||
|
||||
}
|
||||
|
||||
#ifndef USE_HASH_PAIRCACHE
|
||||
|
||||
if (m_ownsPairCache)
|
||||
if (m_ownsPairCache && m_pairCache->hasDeferredRemoval())
|
||||
{
|
||||
|
||||
btBroadphasePairArray& overlappingPairArray = m_pairCache->getOverlappingPairArray();
|
||||
@@ -296,7 +295,6 @@ void btSimpleBroadphase::calculateOverlappingPairs(btDispatcher* dispatcher)
|
||||
#endif//CLEAN_INVALID_PAIRS
|
||||
|
||||
}
|
||||
#endif //USE_HASH_PAIRCACHE
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user