30 m_isSwapped(isSwapped),
31 m_sharedManifold(ci.m_manifold)
57 for (i=0;i<numChildren;i++)
59 if (compoundShape->getDynamicAabbTree())
83 for (i=0;i<numChildren;i++)
115 :m_compoundColObjWrap(compoundObjWrap),m_otherObjWrap(otherObjWrap),m_dispatcher(dispatcher),m_dispatchInfo(dispatchInfo),m_resultOut(resultOut),
116 m_childCollisionAlgorithms(childCollisionAlgorithms),
117 m_sharedManifold(sharedManifold)
127 btAssert(index<compoundShape->getNumChildShapes());
134 btTransform newChildWorldTrans = orgTrans*childTrans ;
138 childShape->
getAabb(newChildWorldTrans,aabbMin0,aabbMax0);
141 aabbMin0 -= extendAabb;
142 aabbMax0 += extendAabb;
159 bool allocatedAlgorithm =
false;
164 allocatedAlgorithm =
true;
169 if (!m_childCollisionAlgorithms[index])
173 algo = m_childCollisionAlgorithms[index];
191 algo->processCollision(&compoundWrap,m_otherObjWrap,m_dispatchInfo,m_resultOut);
209 if(allocatedAlgorithm)
211 algo->~btCollisionAlgorithm();
233 ProcessChildShape(childShape,index);
265 const btDbvt* tree = compoundShape->getDynamicAabbTree();
302 localAabbMin -= extraExtends;
303 localAabbMax += extraExtends;
314 for (i=0;i<numChildren;i++)
329 btVector3 aabbMin0,aabbMax0,aabbMin1,aabbMax1;
331 for (i=0;i<numChildren;i++)
335 childShape = compoundShape->getChildShape(i);
339 const btTransform& childTrans = compoundShape->getChildTransform(i);
340 newChildWorldTrans = orgTrans*childTrans ;
343 childShape->
getAabb(newChildWorldTrans,aabbMin0,aabbMax0);
381 for (i=0;i<numChildren;i++)
388 const btTransform& childTrans = compoundShape->getChildTransform(i);
395 if (frac<hitFraction)
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
void removeChildAlgorithms()
virtual ~btCompoundCollisionAlgorithm()
class btPersistentManifold * m_sharedManifold
virtual btCollisionAlgorithm * findAlgorithm(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, btPersistentManifold *sharedManifold, ebtDispatcherQueryType queryType)=0
void setPersistentManifold(btPersistentManifold *manifoldPtr)
btCompoundLeafCallback(const btCollisionObjectWrapper *compoundObjWrap, const btCollisionObjectWrapper *otherObjWrap, btDispatcher *dispatcher, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut, btCollisionAlgorithm **childCollisionAlgorithms, btPersistentManifold *sharedManifold)
This class is not enabled yet (work-in-progress) to more aggressively activate objects.
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()
btCompoundCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped)
int m_compoundShapeRevision
btManifoldResult is a helper class to manage contact results.
class btIDebugDraw * m_debugDraw
const btCollisionObjectWrapper * getBody1Wrap() const
bool TestAabbAgainstAabb2(const btVector3 &aabbMin1, const btVector3 &aabbMax1, const btVector3 &aabbMin2, const btVector3 &aabbMax2)
conservative test for overlap between two aabbs
const btDispatcherInfo & m_dispatchInfo
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
virtual void setShapeIdentifiersA(int partId0, int index0)
setShapeIdentifiersA/B provides experimental support for per-triangle material / custom material comb...
btAlignedObjectArray< btCollisionAlgorithm * > m_childCollisionAlgorithms
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
btPersistentManifold * m_sharedManifold
btTransform & getWorldTransform()
btScalar m_closestPointDistanceThreshold
int size() const
return the number of elements in the array
const btCollisionObjectWrapper * m_compoundColObjWrap
const btCollisionObjectWrapper * getBody0Wrap() const
btTransform & getChildTransform(int index)
static btDbvtAabbMm FromMM(const btVector3 &mi, const btVector3 &mx)
const btTransform & getWorldTransform() const
btCollisionObject can be used to manage collision detection objects.
bool(* btShapePairCallback)(const btCollisionShape *pShape0, const btCollisionShape *pShape1)
DBVT_PREFIX void collideTVNoStackAlloc(const btDbvtNode *root, const btDbvtVolume &volume, btNodeStack &stack, DBVT_IPOLICY) const
virtual void drawAabb(const btVector3 &from, const btVector3 &to, const btVector3 &color)
const btCollisionObject * getBody0Internal() const
virtual void freeCollisionAlgorithm(void *ptr)=0
virtual void setShapeIdentifiersB(int partId1, int index1)
void setWorldTransform(const btTransform &worldTrans)
const btCollisionShape * getCollisionShape() const
btVector3 can be used to represent 3D points and vectors.
#define ATTRIBUTE_ALIGNED16(a)
DBVT_INLINE const btVector3 & Maxs() const
btManifoldResult * m_resultOut
void Process(const btDbvtNode *leaf)
btManifoldArray manifoldArray
void resize(int newsize, const T &fillData=T())
virtual int getDebugMode() const =0
void setBody1Wrap(const btCollisionObjectWrapper *obj1Wrap)
void preallocateChildAlgorithms(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
btShapePairCallback gCompoundChildShapePairCallback
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...
btCollisionAlgorithm ** m_childCollisionAlgorithms
void setBody0Wrap(const btCollisionObjectWrapper *obj0Wrap)
DBVT_INLINE const btVector3 & Mins() const
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...
const btCollisionShape * getCollisionShape() const
btScalar calculateTimeOfImpact(btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
void ProcessChildShape(const btCollisionShape *childShape, int index)
const btCollisionObjectWrapper * m_otherObjWrap
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btDispatcher * m_dispatcher
const btCollisionObject * getCollisionObject() const
int getNumChildShapes() const