- removed STL from the Bullet library: replace std::vector by btAlignedObjectArray. Also removed the std::set for overlapping pair set, and turned it into an overlapping pair array. The SAP only adds objects, never removed. Removal is postponed for during traversal of overlapping pairs (duplicates and non-overlapping pairs are removed during that traversal).
- added heap sort and binary search/linear search to btAlignedObjectArray - fixed wrong cast, thanks Hamstray, http://www.continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1015
This commit is contained in:
@@ -21,7 +21,7 @@ subject to the following restrictions:
|
||||
#include "btBroadphaseInterface.h"
|
||||
#include "btBroadphaseProxy.h"
|
||||
#include "../../LinearMath/btPoint3.h"
|
||||
#include <set>
|
||||
#include "../../LinearMath/btAlignedObjectArray.h"
|
||||
|
||||
|
||||
struct btOverlapCallback
|
||||
@@ -37,8 +37,9 @@ virtual ~btOverlapCallback()
|
||||
///Typically managed by the Broadphase, Axis3Sweep or btSimpleBroadphase
|
||||
class btOverlappingPairCache : public btBroadphaseInterface
|
||||
{
|
||||
protected:
|
||||
//avoid brute-force finding all the time
|
||||
std::set<btBroadphasePair> m_overlappingPairSet;
|
||||
btAlignedObjectArray<btBroadphasePair> m_overlappingPairArray;
|
||||
|
||||
//during the dispatch, check that user doesn't destroy/create proxy
|
||||
bool m_blockedForChanges;
|
||||
@@ -48,7 +49,7 @@ class btOverlappingPairCache : public btBroadphaseInterface
|
||||
btOverlappingPairCache();
|
||||
virtual ~btOverlappingPairCache();
|
||||
|
||||
void processAllOverlappingPairs(btOverlapCallback*);
|
||||
virtual void processAllOverlappingPairs(btOverlapCallback*);
|
||||
|
||||
void removeOverlappingPair(btBroadphasePair& pair);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user