30 m_isSwapped(isSwapped),
31 m_sharedManifold(ci.m_manifold)
57 for (i=0;i<numChildren;i++)
59 if (compoundShape->getDynamicAabbTree())
77 for (i=0;i<numChildren;i++)
109 :m_compoundColObjWrap(compoundObjWrap),m_otherObjWrap(otherObjWrap),m_dispatcher(dispatcher),m_dispatchInfo(dispatchInfo),m_resultOut(resultOut),
110 m_childCollisionAlgorithms(childCollisionAlgorithms),
111 m_sharedManifold(sharedManifold)
121 btAssert(index<compoundShape->getNumChildShapes());
128 btTransform newChildWorldTrans = orgTrans*childTrans ;
131 btVector3 aabbMin0,aabbMax0,aabbMin1,aabbMax1;
132 childShape->
getAabb(newChildWorldTrans,aabbMin0,aabbMax0);
148 if (!m_childCollisionAlgorithms[index])
149 m_childCollisionAlgorithms[index] = m_dispatcher->
findAlgorithm(&compoundWrap,m_otherObjWrap,m_sharedManifold);
168 m_childCollisionAlgorithms[index]->
processCollision(&compoundWrap,m_otherObjWrap,m_dispatchInfo,m_resultOut);
206 ProcessChildShape(childShape,index);
238 const btDbvt* tree = compoundShape->getDynamicAabbTree();
253 for (
int m=0;m<manifoldArray.
size();m++)
255 if (manifoldArray[m]->getNumContacts())
284 for (i=0;i<numChildren;i++)
299 btVector3 aabbMin0,aabbMax0,aabbMin1,aabbMax1;
301 for (i=0;i<numChildren;i++)
305 childShape = compoundShape->getChildShape(i);
309 const btTransform& childTrans = compoundShape->getChildTransform(i);
310 newChildWorldTrans = orgTrans*childTrans ;
313 childShape->
getAabb(newChildWorldTrans,aabbMin0,aabbMax0);
351 for (i=0;i<numChildren;i++)
358 const btTransform& childTrans = compoundShape->getChildTransform(i);
365 if (frac<hitFraction)
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
void removeChildAlgorithms()
DBVT_INLINE const btVector3 & Mins() const
virtual btCollisionAlgorithm * findAlgorithm(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, btPersistentManifold *sharedManifold=0)=0
virtual ~btCompoundCollisionAlgorithm()
const btCollisionObjectWrapper * getBody0Wrap() const
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)=0
class btPersistentManifold * m_sharedManifold
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 btCollisionShape * getCollisionShape() const
bool TestAabbAgainstAabb2(const btVector3 &aabbMin1, const btVector3 &aabbMax1, const btVector3 &aabbMin2, const btVector3 &aabbMax2)
conservative test for overlap between two aabbs
int getNumChildShapes() const
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...
DBVT_INLINE const btVector3 & Maxs() const
btAlignedObjectArray< btCollisionAlgorithm * > m_childCollisionAlgorithms
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
btPersistentManifold * m_sharedManifold
btTransform & getWorldTransform()
const btCollisionObjectWrapper * m_compoundColObjWrap
btTransform & getChildTransform(int index)
static btDbvtAabbMm FromMM(const btVector3 &mi, const btVector3 &mx)
const btCollisionObject * getCollisionObject() const
btCollisionObject can be used to manage collision detection objects.
bool(* btShapePairCallback)(const btCollisionShape *pShape0, const btCollisionShape *pShape1)
DBVT_PREFIX void collideTV(const btDbvtNode *root, const btDbvtVolume &volume, DBVT_IPOLICY) const
virtual void drawAabb(const btVector3 &from, const btVector3 &to, const btVector3 &color)
virtual void freeCollisionAlgorithm(void *ptr)=0
virtual void setShapeIdentifiersB(int partId1, int index1)
void setWorldTransform(const btTransform &worldTrans)
btVector3 can be used to represent 3D points and vectors.
#define ATTRIBUTE_ALIGNED16(a)
int size() const
return the number of elements in the array
btManifoldResult * m_resultOut
void Process(const btDbvtNode *leaf)
const btCollisionObject * getBody0Internal() const
void resize(int newsize, const T &fillData=T())
virtual int getDebugMode() const =0
void setBody1Wrap(const btCollisionObjectWrapper *obj1Wrap)
const btTransform & getWorldTransform() const
void preallocateChildAlgorithms(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap)
const btCollisionObjectWrapper * getBody1Wrap() const
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)
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...
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...
const btCollisionShape * getCollisionShape() const
btDispatcher * m_dispatcher
static btDbvtVolume bounds(const tNodeArray &leaves)