41 btAssert (col1ObjWrap->getCollisionShape()->isCompound());
64 for (i=0;i<pairs.
size();i++)
66 if (pairs[i].m_userPointer)
79 int numChildren = pairs.
size();
81 for (i=0;i<numChildren;i++)
83 if (pairs[i].m_userPointer)
116 :m_numOverlapPairs(0),m_compound0ColObjWrap(compound1ObjWrap),m_compound1ColObjWrap(compound0ObjWrap),m_dispatcher(dispatcher),m_dispatchInfo(dispatchInfo),m_resultOut(resultOut),
117 m_childCollisionAlgorithmCache(childAlgorithmsCache),
118 m_sharedManifold(sharedManifold)
128 BT_PROFILE(
"btCompoundCompoundLeafCallback::Process");
141 btAssert(childIndex0<compoundShape0->getNumChildShapes());
144 btAssert(childIndex1<compoundShape1->getNumChildShapes());
152 btTransform newChildWorldTrans0 = orgTrans0*childTrans0 ;
156 btTransform newChildWorldTrans1 = orgTrans1*childTrans1 ;
160 btVector3 aabbMin0,aabbMax0,aabbMin1,aabbMax1;
161 childShape0->
getAabb(newChildWorldTrans0,aabbMin0,aabbMax0);
162 childShape1->
getAabb(newChildWorldTrans1,aabbMin1,aabbMax1);
166 aabbMin0 -= thresholdVec;
167 aabbMax0 += thresholdVec;
200 pair->m_userPointer = colAlgo;
219 colAlgo->
processCollision(&compoundWrap0,&compoundWrap1,m_dispatchInfo,m_resultOut);
236 newmin -=
btVector3(distanceThreshold, distanceThreshold, distanceThreshold);
237 newmax +=
btVector3(distanceThreshold, distanceThreshold, distanceThreshold);
263 treshold=stkStack.
size()-4;
308 const btDbvt* tree0 = compoundShape0->getDynamicAabbTree();
310 if (!tree0 || !tree1)
333 for (i=0;i<pairs.
size();i++)
335 if (pairs[i].m_userPointer)
339 for (
int m=0;m<manifoldArray.
size();m++)
341 if (manifoldArray[m]->getNumContacts())
379 btVector3 aabbMin0,aabbMax0,aabbMin1,aabbMax1;
381 for (i=0;i<pairs.size();i++)
383 if (pairs[i].m_userPointer)
393 childShape0 = compoundShape0->getChildShape(pairs[i].m_indexA);
396 const btTransform& childTrans0 = compoundShape0->getChildTransform(pairs[i].m_indexA);
397 newChildWorldTrans0 = orgTrans0*childTrans0 ;
398 childShape0->
getAabb(newChildWorldTrans0,aabbMin0,aabbMax0);
401 aabbMin0 -= thresholdVec;
402 aabbMax0 += thresholdVec;
409 childShape1 = compoundShape1->
getChildShape(pairs[i].m_indexB);
413 newChildWorldTrans1 = orgTrans1*childTrans1 ;
414 childShape1->
getAabb(newChildWorldTrans1,aabbMin1,aabbMax1);
417 aabbMin1 -= thresholdVec;
418 aabbMax1 += thresholdVec;
void Process(const btDbvtNode *leaf0, const btDbvtNode *leaf1)
btDispatcher * m_dispatcher
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
void push_back(const T &_Val)
btScalar calculateTimeOfImpact(btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
DBVT_INLINE const btVector3 & Mins() const
virtual void getAllContactManifolds(btManifoldArray &manifoldArray)
virtual btSimplePair * addOverlappingPair(int indexA, int indexB)
const btCollisionObjectWrapper * getBody0Wrap() const
The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods It...
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)=0
class btPersistentManifold * m_sharedManifold
virtual btCollisionAlgorithm * findAlgorithm(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, btPersistentManifold *sharedManifold, ebtDispatcherQueryType queryType)=0
int m_compoundShapeRevision0
btCompoundCompoundCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped)
void setPersistentManifold(btPersistentManifold *manifoldPtr)
const btCollisionObjectWrapper * m_compound0ColObjWrap
const btDbvt * getDynamicAabbTree() const
btPersistentManifold * m_sharedManifold
virtual ~btCompoundCompoundCollisionAlgorithm()
The btDbvt class implements a fast dynamic bounding volume tree based on axis aligned bounding boxes ...
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
void refreshContactPoints()
btManifoldResult is a helper class to manage contact results.
virtual ~btCollisionAlgorithm()
int getUpdateRevision() const
const btCollisionShape * getCollisionShape() const
btCompoundCompoundLeafCallback(const btCollisionObjectWrapper *compound1ObjWrap, const btCollisionObjectWrapper *compound0ObjWrap, btDispatcher *dispatcher, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut, btHashedSimplePairCache *childAlgorithmsCache, btPersistentManifold *sharedManifold)
bool TestAabbAgainstAabb2(const btVector3 &aabbMin1, const btVector3 &aabbMax1, const btVector3 &aabbMin2, const btVector3 &aabbMax2)
conservative test for overlap between two aabbs
btSimplePairArray & getOverlappingPairArray()
virtual void getAabb(const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const =0
getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t...
btDispatcher * m_dispatcher
const btDispatcherInfo & m_dispatchInfo
void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0), to reduce performance overhead of run-time memory (de)allocations.
virtual void setShapeIdentifiersA(int partId0, int index0)
setShapeIdentifiersA/B provides experimental support for per-triangle material / custom material comb...
DBVT_INLINE const btVector3 & Maxs() const
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
btManifoldResult * m_resultOut
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
btScalar m_closestPointDistanceThreshold
btTransform & getChildTransform(int index)
static btDbvtAabbMm FromMM(const btVector3 &mi, const btVector3 &mx)
const btCollisionObject * getCollisionObject() const
class btHashedSimplePairCache * m_childCollisionAlgorithmCache
#define btAlignedFree(ptr)
btCollisionObject can be used to manage collision detection objects.
void removeChildAlgorithms()
bool(* btShapePairCallback)(const btCollisionShape *pShape0, const btCollisionShape *pShape1)
static DBVT_INLINE bool MyIntersect(const btDbvtAabbMm &a, const btDbvtAabbMm &b, const btTransform &xform, btScalar distanceThreshold)
virtual void freeCollisionAlgorithm(void *ptr)=0
virtual void setShapeIdentifiersB(int partId1, int index1)
int m_compoundShapeRevision1
btVector3 can be used to represent 3D points and vectors.
virtual void getAllContactManifolds(btManifoldArray &manifoldArray)=0
int size() const
return the number of elements in the array
static void MycollideTT(const btDbvtNode *root0, const btDbvtNode *root1, const btTransform &xform, btCompoundCompoundLeafCallback *callback, btScalar distanceThreshold)
btManifoldArray manifoldArray
void resize(int newsize, const T &fillData=T())
DBVT_INLINE bool isinternal() const
void setBody1Wrap(const btCollisionObjectWrapper *obj1Wrap)
const btTransform & getWorldTransform() const
btCompoundCollisionAlgorithm supports collision between CompoundCollisionShapes and other collision s...
btSimplePair * findPair(int indexA, int indexB)
const btCollisionObjectWrapper * m_compound1ColObjWrap
DBVT_INLINE bool Intersect(const btDbvtAabbMm &a, const btDbvtAabbMm &b)
#define btAlignedAlloc(size, alignment)
const btCollisionObjectWrapper * getBody1Wrap() const
virtual ~btHashedSimplePairCache()
void btTransformAabb(const btVector3 &halfExtents, btScalar margin, const btTransform &t, btVector3 &aabbMinOut, btVector3 &aabbMaxOut)
The btCompoundShape allows to store multiple other btCollisionShapes This allows for moving concave c...
void setBody0Wrap(const btCollisionObjectWrapper *obj0Wrap)
btSimplePairArray m_removePairs
btCollisionShape * getChildShape(int index)
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatche...
virtual void * removeOverlappingPair(int indexA, int indexB)
class btHashedSimplePairCache * m_childCollisionAlgorithmCache
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btShapePairCallback gCompoundCompoundChildShapePairCallback