34 m_spuCollisionTaskProcess(0),
35 m_threadInterface(threadInterface),
36 m_maxNumOutstandingTasks(maxNumOutstandingTasks)
71 return supported0 && supported1;
131 int proxyType1 = colObj1->getCollisionShape()->getShapeType();
142 supportsSpuDispatch =
false;
152 supportsSpuDispatch =
false;
156 if (supportsSpuDispatch)
160 #ifdef ALLOCATE_SEPARATELY
223 for (i=0;i<numTotalPairs;)
227 int endIndex = (i+pairRange) < numTotalPairs ? i+pairRange : numTotalPairs;
235 for (i=0;i<numTotalPairs;i++)
virtual btScalar calculateTimeOfImpact(btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)=0
void setNumTasks(int maxNumTasks)
set the maximum number of SPU tasks allocated
virtual int getNumTasks() const =0
bool supportsDispatchPairOnSpu(int proxyType0, int proxyType1)
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)=0
SpuCollisionTaskProcess handles SPU processing of collision pairs.
void initialize2(bool useEpa=false)
call initialize in the beginning of the frame, before addCollisionPairToTask
btCollisionConfiguration allows to configure Bullet collision detection stack allocator size...
btCollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs...
void flush2()
call flush to submit potential outstanding work to SPUs and wait for all involved SPUs to be finished...
#define SPU_BATCHSIZE_BROADPHASE_PAIRS
Tuning value to optimized SPU utilization Too small value means Task overhead is large compared to co...
SpuGatheringCollisionDispatcher * m_dispatcher
virtual void dispatchAllCollisionPairs(btOverlappingPairCache *pairCache, const btDispatcherInfo &dispatchInfo, btDispatcher *dispatcher)
int getCollisionFlags() const
btManifoldResult is a helper class to manage contact results.
The btOverlappingPairCache provides an interface for overlapping pair management (add, remove, storage), used by the btBroadphaseInterface broadphases.
virtual bool needsCollision(const btCollisionObject *body0, const btCollisionObject *body1)
btTransform & getWorldTransform()
void addWorkToTask(void *pairArrayPtr, int startIndex, int endIndex)
batch up additional work to a current task for SPU processing. When batch is full, it issues the task.
btCollisionAlgorithm * findAlgorithm(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, btPersistentManifold *sharedManifold=0)
btCollisionObject can be used to manage collision detection objects.
virtual int getNumOverlappingPairs() const =0
virtual bool processOverlap(btBroadphasePair &collisionPair)
btBroadphaseProxy * m_pProxy1
btCollisionAlgorithm * m_algorithm
class btThreadSupportInterface * m_threadInterface
btBroadphaseProxy * m_pProxy0
interface for iterating all overlapping collision pairs, no matter how those pairs are stored (array...
virtual ~SpuGatheringCollisionDispatcher()
SpuGatheringCollisionDispatcher can use SPU to gather and calculate collision detection Time of Impac...
SpuCollisionTaskProcess * m_spuCollisionTaskProcess
SpuGatheringCollisionDispatcher(class btThreadSupportInterface *threadInterface, unsigned int maxNumOutstandingTasks, btCollisionConfiguration *collisionConfiguration)
virtual void dispatchAllCollisionPairs(btOverlappingPairCache *pairCache, const btDispatcherInfo &dispatchInfo, btDispatcher *dispatcher)
btSpuCollisionPairCallback(const btDispatcherInfo &dispatchInfo, SpuGatheringCollisionDispatcher *dispatcher)
#define btAlignedAlloc(size, alignment)
The btCompoundShape allows to store multiple other btCollisionShapes This allows for moving concave c...
btPersistentManifold * m_manifold
virtual void * allocateCollisionAlgorithm(int size)
btDispatcher * m_dispatcher1
virtual bool needsCollision(const btCollisionObject *body0, const btCollisionObject *body1)=0
virtual btBroadphasePair * getOverlappingPairArrayPtr()=0
#define MAX_SPU_COMPOUND_SUBSHAPES
unsigned int m_maxNumOutstandingTasks
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
const btDispatcherInfo & m_dispatchInfo
const btCollisionShape * getCollisionShape() const
virtual void processAllOverlappingPairs(btOverlapCallback *, btDispatcher *dispatcher)=0
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
int getNumChildShapes() const
The btBroadphasePair class contains a pair of aabb-overlapping objects.