| Bullet Collision Detection & Physics Library
    | 
 
 
 
Go to the documentation of this file.
   28 #define USE_LOCAL_STACK 1 
   42         btAssert(col1ObjWrap->getCollisionShape()->isCompound());
 
   47         const btCompoundShape* compoundShape1 = static_cast<const btCompoundShape*>(col1ObjWrap->getCollisionShape());
 
   62         for (i = 0; i < pairs.
size(); i++)
 
   64                 if (pairs[i].m_userPointer)
 
   75         int numChildren = pairs.
size();
 
   77         for (i = 0; i < numChildren; i++)
 
   79                 if (pairs[i].m_userPointer)
 
  116                 BT_PROFILE(
"btCompoundCompoundLeafCallback::Process");
 
  126                 btAssert(childIndex0 < compoundShape0->getNumChildShapes());
 
  129                 btAssert(childIndex1 < compoundShape1->getNumChildShapes());
 
  137                 btTransform newChildWorldTrans0 = orgTrans0 * childTrans0;
 
  141                 btTransform newChildWorldTrans1 = orgTrans1 * childTrans1;
 
  144                 btVector3 aabbMin0, aabbMax0, aabbMin1, aabbMax1;
 
  145                 childShape0->
getAabb(newChildWorldTrans0, aabbMin0, aabbMax0);
 
  146                 childShape1->
getAabb(newChildWorldTrans1, aabbMin1, aabbMax1);
 
  150                 aabbMin0 -= thresholdVec;
 
  151                 aabbMax0 += thresholdVec;
 
  165                         bool removePair = 
false;
 
  183                                         pair->m_userPointer = colAlgo;
 
  220         newmin -= 
btVector3(distanceThreshold, distanceThreshold, distanceThreshold);
 
  221         newmax += 
btVector3(distanceThreshold, distanceThreshold, distanceThreshold);
 
  236 #ifdef USE_LOCAL_STACK 
  248                                 if (depth > treshold)
 
  251                                         treshold = stkStack.
size() - 4;
 
  295         const btDbvt* tree0 = compoundShape0->getDynamicAabbTree();
 
  296         const btDbvt* tree1 = compoundShape1->getDynamicAabbTree();
 
  297         if (!tree0 || !tree1)
 
  317 #ifdef USE_LOCAL_STACK 
  322                 for (i = 0; i < pairs.
size(); i++)
 
  324                         if (pairs[i].m_userPointer)
 
  360                 btVector3 aabbMin0, aabbMax0, aabbMin1, aabbMax1;
 
  362                 for (i = 0; i < pairs.size(); i++)
 
  364                         if (pairs[i].m_userPointer)
 
  372                                         childShape0 = compoundShape0->getChildShape(pairs[i].m_indexA);
 
  373                                         const btTransform& childTrans0 = compoundShape0->getChildTransform(pairs[i].m_indexA);
 
  375                                         childShape0->
getAabb(newChildWorldTrans0, aabbMin0, aabbMax0);
 
  378                                 aabbMin0 -= thresholdVec;
 
  379                                 aabbMax0 += thresholdVec;
 
  384                                         childShape1 = compoundShape1->getChildShape(pairs[i].m_indexB);
 
  385                                         const btTransform& childTrans1 = compoundShape1->getChildTransform(pairs[i].m_indexB);
 
  387                                         childShape1->
getAabb(newChildWorldTrans1, aabbMin1, aabbMax1);
 
  390                                 aabbMin1 -= thresholdVec;
 
  391                                 aabbMax1 += thresholdVec;
 
  
virtual void setShapeIdentifiersB(int partId1, int index1)
btCollisionObject can be used to manage collision detection objects.
#define btAlignedFree(ptr)
virtual ~btHashedSimplePairCache()
int getUpdateRevision() const
virtual ~btCollisionAlgorithm()
btTransform & getChildTransform(int index)
btDispatcher * m_dispatcher
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btShapePairCallback gCompoundCompoundChildShapePairCallback
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
btScalar calculateTimeOfImpact(btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
void setBody1Wrap(const btCollisionObjectWrapper *obj1Wrap)
const DBVT_INLINE btVector3 & Maxs() const
void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0),...
btManifoldResult * m_resultOut
bool(* btShapePairCallback)(const btCollisionShape *pShape0, const btCollisionShape *pShape1)
#define btAlignedAlloc(size, alignment)
const btTransform & getWorldTransform() const
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
int m_compoundShapeRevision0
void removeChildAlgorithms()
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)=0
btSimplePairArray m_removePairs
btCompoundCompoundLeafCallback(const btCollisionObjectWrapper *compound1ObjWrap, const btCollisionObjectWrapper *compound0ObjWrap, btDispatcher *dispatcher, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut, btHashedSimplePairCache *childAlgorithmsCache, btPersistentManifold *sharedManifold)
static DBVT_INLINE bool MyIntersect(const btDbvtAabbMm &a, const btDbvtAabbMm &b, const btTransform &xform, btScalar distanceThreshold)
virtual void freeCollisionAlgorithm(void *ptr)=0
btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatche...
class btHashedSimplePairCache * m_childCollisionAlgorithmCache
const btCollisionObjectWrapper * getBody1Wrap() const
const btCollisionObjectWrapper * m_compound0ColObjWrap
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
void setBody0Wrap(const btCollisionObjectWrapper *obj0Wrap)
int m_compoundShapeRevision1
The btDbvt class implements a fast dynamic bounding volume tree based on axis aligned bounding boxes ...
btManifoldResult is a helper class to manage contact results.
bool TestAabbAgainstAabb2(const btVector3 &aabbMin1, const btVector3 &aabbMax1, const btVector3 &aabbMin2, const btVector3 &aabbMax2)
conservative test for overlap between two aabbs
void initializeFromBuffer(void *buffer, int size, int capacity)
const btCollisionShape * getCollisionShape() const
void resize(int newsize, const T &fillData=T())
const DBVT_INLINE btVector3 & Mins() const
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.
btManifoldArray manifoldArray
DBVT_INLINE bool Intersect(const btDbvtAabbMm &a, const btDbvtAabbMm &b)
const btCollisionObject * getCollisionObject() const
const btCollisionObjectWrapper * getBody0Wrap() const
btVector3 can be used to represent 3D points and vectors.
btSimplePairArray & getOverlappingPairArray()
btCompoundCompoundCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped)
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
static btDbvtAabbMm FromMM(const btVector3 &mi, const btVector3 &mx)
virtual btCollisionAlgorithm * findAlgorithm(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, btPersistentManifold *sharedManifold, ebtDispatcherQueryType queryType)=0
btSimplePair * findPair(int indexA, int indexB)
btCompoundCollisionAlgorithm supports collision between CompoundCollisionShapes and other collision s...
void setPersistentManifold(btPersistentManifold *manifoldPtr)
#define ATTRIBUTE_ALIGNED16(a)
void Process(const btDbvtNode *leaf0, const btDbvtNode *leaf1)
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
The btCompoundShape allows to store multiple other btCollisionShapes This allows for moving concave c...
DBVT_INLINE bool isinternal() const
void btTransformAabb(const btVector3 &halfExtents, btScalar margin, const btTransform &t, btVector3 &aabbMinOut, btVector3 &aabbMaxOut)
class btHashedSimplePairCache * m_childCollisionAlgorithmCache
virtual void * removeOverlappingPair(int indexA, int indexB)
void refreshContactPoints()
btPersistentManifold * m_sharedManifold
static void MycollideTT(const btDbvtNode *root0, const btDbvtNode *root1, const btTransform &xform, btCompoundCompoundLeafCallback *callback, btScalar distanceThreshold)
virtual void getAllContactManifolds(btManifoldArray &manifoldArray)
virtual void getAllContactManifolds(btManifoldArray &manifoldArray)=0
virtual btSimplePair * addOverlappingPair(int indexA, int indexB)
class btPersistentManifold * m_sharedManifold
btDispatcher * m_dispatcher
void push_back(const T &_Val)
virtual void setShapeIdentifiersA(int partId0, int index0)
setShapeIdentifiersA/B provides experimental support for per-triangle material / custom material comb...
btCollisionShape * getChildShape(int index)
virtual ~btCompoundCompoundCollisionAlgorithm()
const btCollisionObjectWrapper * m_compound1ColObjWrap
btScalar m_closestPointDistanceThreshold
const btDispatcherInfo & m_dispatchInfo
int size() const
return the number of elements in the array