31 m_sharedManifold(ci.m_manifold)
52 int numChildren = compoundShape->getNumChildShapes();
56 for (i = 0; i < numChildren; i++)
58 if (compoundShape->getDynamicAabbTree())
79 for (i = 0; i < numChildren; i++)
125 const btTransform& childTrans = compoundShape->getChildTransform(index);
126 btTransform newChildWorldTrans = orgTrans * childTrans;
130 childShape->getAabb(newChildWorldTrans, aabbMin0, aabbMax0);
133 aabbMin0 -= extendAabb;
134 aabbMax0 += extendAabb;
145 preTransform = preTransform *(*(this->m_compoundColObjWrap->
m_preTransform));
150 bool allocatedAlgorithm =
false;
155 allocatedAlgorithm =
true;
202 if (allocatedAlgorithm)
252 const btDbvt*
tree = compoundShape->getDynamicAabbTree();
267 for (
int m = 0; m < manifoldArray.
size(); m++)
286 otherObjWrap->
getCollisionShape()->getAabb(otherInCompoundSpace, localAabbMin, localAabbMax);
288 localAabbMin -= extraExtends;
289 localAabbMax += extraExtends;
300 for (i = 0; i < numChildren; i++)
302 callback.ProcessChildShape(compoundShape->getChildShape(i), i);
315 btVector3 aabbMin0, aabbMax0, aabbMin1, aabbMax1;
317 for (i = 0; i < numChildren; i++)
321 childShape = compoundShape->getChildShape(i);
325 const btTransform& childTrans = compoundShape->getChildTransform(i);
326 newChildWorldTrans = orgTrans * childTrans;
329 childShape->getAabb(newChildWorldTrans, aabbMin0, aabbMax0);
350 btAssert(colObj->getCollisionShape()->isCompound());
367 for (i = 0; i < numChildren; i++)
372 orgTrans = colObj->getWorldTransform();
374 const btTransform& childTrans = compoundShape->getChildTransform(i);
376 colObj->setWorldTransform(orgTrans * childTrans);
381 if (
frac < hitFraction)
387 colObj->setWorldTransform(orgTrans);
SIMD_FORCE_INLINE bool TestAabbAgainstAabb2(const btVector3 &aabbMin1, const btVector3 &aabbMax1, const btVector3 &aabbMin2, const btVector3 &aabbMax2)
conservative test for overlap between two aabbs
SIMD_FORCE_INLINE void btTransformAabb(const btVector3 &halfExtents, btScalar margin, const btTransform &t, btVector3 &aabbMinOut, btVector3 &aabbMaxOut)
btCollisionShape
The btCollisionShape class provides an interface for collision shapes that can be shared among btColl...
btShapePairCallback gCompoundChildShapePairCallback
bool(* btShapePairCallback)(const btCollisionShape *pShape0, const btCollisionShape *pShape1)
btCompoundShape(bool enableDynamicAabbTree=true, const int initialChildCapacity=0)
int getNumChildShapes() const
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
@ BT_CLOSEST_POINT_ALGORITHMS
@ BT_CONTACT_POINT_ALGORITHMS
SIMD_FORCE_INLINE int getNumContacts() const
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define ATTRIBUTE_ALIGNED16(a)
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
This class is not enabled yet (work-in-progress) to more aggressively activate objects.
SIMD_FORCE_INLINE int size() const
return the number of elements in the array
SIMD_FORCE_INLINE void resize(int newsize, const T &fillData=T())
btDispatcher * m_dispatcher
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)=0
virtual ~btCollisionAlgorithm()
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
class btPersistentManifold * m_sharedManifold
btAlignedObjectArray< btCollisionAlgorithm * > m_childCollisionAlgorithms
void removeChildAlgorithms()
btScalar calculateTimeOfImpact(btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)
void preallocateChildAlgorithms(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap)
btCompoundCollisionAlgorithm(const btCollisionAlgorithmConstructionInfo &ci, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, bool isSwapped)
int m_compoundShapeRevision
virtual ~btCompoundCollisionAlgorithm()
virtual void freeCollisionAlgorithm(void *ptr)=0
virtual btCollisionAlgorithm * findAlgorithm(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, btPersistentManifold *sharedManifold, ebtDispatcherQueryType queryType)=0
virtual int getDebugMode() const =0
virtual void drawAabb(const btVector3 &from, const btVector3 &to, const btVector3 &color)
btManifoldResult is a helper class to manage contact results.
virtual void setShapeIdentifiersA(int partId0, int index0)
setShapeIdentifiersA/B provides experimental support for per-triangle material / custom material comb...
void setBody0Wrap(const btCollisionObjectWrapper *obj0Wrap)
const btCollisionObject * getBody0Internal() const
const btCollisionObjectWrapper * getBody1Wrap() const
const btCollisionObjectWrapper * getBody0Wrap() const
void setBody1Wrap(const btCollisionObjectWrapper *obj1Wrap)
void setPersistentManifold(btPersistentManifold *manifoldPtr)
virtual void setShapeIdentifiersB(int partId1, int index1)
btScalar m_closestPointDistanceThreshold
SIMD_FORCE_INLINE void refreshContactPoints()
DEGForeachIDComponentCallback callback
ccl_device_inline float frac(float x, int *ix)
SIMD_FORCE_INLINE const btCollisionShape * getCollisionShape() const
SIMD_FORCE_INLINE const btTransform & getWorldTransform() const
const btTransform * m_preTransform
SIMD_FORCE_INLINE const btCollisionObject * getCollisionObject() const
const btCollisionObjectWrapper * m_otherObjWrap
btDispatcher * m_dispatcher
void ProcessChildShape(const btCollisionShape *childShape, int index)
btPersistentManifold * m_sharedManifold
btCompoundLeafCallback(const btCollisionObjectWrapper *compoundObjWrap, const btCollisionObjectWrapper *otherObjWrap, btDispatcher *dispatcher, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut, btCollisionAlgorithm **childCollisionAlgorithms, btPersistentManifold *sharedManifold)
btManifoldResult * m_resultOut
const btDispatcherInfo & m_dispatchInfo
btCollisionAlgorithm ** m_childCollisionAlgorithms
void Process(const btDbvtNode *leaf)
const btCollisionObjectWrapper * m_compoundColObjWrap
static btDbvtAabbMm FromMM(const btVector3 &mi, const btVector3 &mx)
DBVT_INLINE const btVector3 & Mins() const
DBVT_INLINE const btVector3 & Maxs() const
class btIDebugDraw * m_debugDraw