Bullet Collision Detection & Physics Library: btCollisionDispatcher.cpp Source File

Bullet Collision Detection & Physics Library

btCollisionDispatcher.cpp
Go to the documentation of this file.
1 /*
2 Bullet Continuous Collision Detection and Physics Library
3 Copyright (c) 2003-2006 Erwin Coumans http://continuousphysics.com/Bullet/
4
5 This software is provided 'as-is', without any express or implied warranty.
6 In no event will the authors be held liable for any damages arising from the use of this software.
7 Permission is granted to anyone to use this software for any purpose,
8 including commercial applications, and to alter it and redistribute it freely,
9 subject to the following restrictions:
10
11 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
12 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
13 3. This notice may not be removed or altered from any source distribution.
14 */
15
16
17
18 #include "btCollisionDispatcher.h"
19 #include "LinearMath/btQuickprof.h"
20
21 #include "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.h"
22
23 #include "BulletCollision/CollisionShapes/btCollisionShape.h"
24 #include "BulletCollision/CollisionDispatch/btCollisionObject.h"
25 #include "BulletCollision/BroadphaseCollision/btOverlappingPairCache.h"
26 #include "LinearMath/btPoolAllocator.h"
27 #include "BulletCollision/CollisionDispatch/btCollisionConfiguration.h"
28 #include "BulletCollision/CollisionDispatch/btCollisionObjectWrapper.h"
29
30 int gNumManifold = 0;
31
32 #ifdef BT_DEBUG
33 #include <stdio.h>
34 #endif
35
36
37 btCollisionDispatcher::btCollisionDispatcher (btCollisionConfiguration* collisionConfiguration):
38 m_dispatcherFlags(btCollisionDispatcher::CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD),
39 m_collisionConfiguration(collisionConfiguration)
40 {
41 int i;
42
43 setNearCallback(defaultNearCallback);
44
45 m_collisionAlgorithmPoolAllocator = collisionConfiguration->getCollisionAlgorithmPool();
46
47 m_persistentManifoldPoolAllocator = collisionConfiguration->getPersistentManifoldPool();
48
49 for (i=0;i<MAX_BROADPHASE_COLLISION_TYPES;i++)
50 {
51 for (int j=0;j<MAX_BROADPHASE_COLLISION_TYPES;j++)
52 {
53 m_doubleDispatchContactPoints[i][j] = m_collisionConfiguration->getCollisionAlgorithmCreateFunc(i,j);
54 btAssert(m_doubleDispatchContactPoints[i][j]);
55 m_doubleDispatchClosestPoints[i][j] = m_collisionConfiguration->getClosestPointsAlgorithmCreateFunc(i, j);
56
57 }
58 }
59
60
61 }
62
63
64 void btCollisionDispatcher::registerCollisionCreateFunc(int proxyType0, int proxyType1, btCollisionAlgorithmCreateFunc *createFunc)
65 {
66 m_doubleDispatchContactPoints[proxyType0][proxyType1] = createFunc;
67 }
68
69 void btCollisionDispatcher::registerClosestPointsCreateFunc(int proxyType0, int proxyType1, btCollisionAlgorithmCreateFunc *createFunc)
70 {
71 m_doubleDispatchClosestPoints[proxyType0][proxyType1] = createFunc;
72 }
73
74 btCollisionDispatcher::~btCollisionDispatcher()
75 {
76 }
77
78 btPersistentManifold* btCollisionDispatcher::getNewManifold(const btCollisionObject* body0,const btCollisionObject* body1)
79 {
80 gNumManifold++;
81
82 //btAssert(gNumManifold < 65535);
83
84
85
86 //optional relative contact breaking threshold, turned on by default (use setDispatcherFlags to switch off feature for improved performance)
87
88 btScalar contactBreakingThreshold = (m_dispatcherFlags & btCollisionDispatcher::CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD) ?
89 btMin(body0->getCollisionShape()->getContactBreakingThreshold(gContactBreakingThreshold) , body1->getCollisionShape()->getContactBreakingThreshold(gContactBreakingThreshold))
90 : gContactBreakingThreshold ;
91
92 btScalar contactProcessingThreshold = btMin(body0->getContactProcessingThreshold(),body1->getContactProcessingThreshold());
93
94 void* mem = m_persistentManifoldPoolAllocator->allocate( sizeof( btPersistentManifold ) );
95 if (NULL == mem)
96 {
97 //we got a pool memory overflow, by default we fallback to dynamically allocate memory. If we require a contiguous contact pool then assert.
98 if ((m_dispatcherFlags&CD_DISABLE_CONTACTPOOL_DYNAMIC_ALLOCATION)==0)
99 {
100 mem = btAlignedAlloc(sizeof(btPersistentManifold),16);
101 } else
102 {
103 btAssert(0);
104 //make sure to increase the m_defaultMaxPersistentManifoldPoolSize in the btDefaultCollisionConstructionInfo/btDefaultCollisionConfiguration
105 return 0;
106 }
107 }
108 btPersistentManifold* manifold = new(mem) btPersistentManifold (body0,body1,0,contactBreakingThreshold,contactProcessingThreshold);
109 manifold->m_index1a = m_manifoldsPtr.size();
110 m_manifoldsPtr.push_back(manifold);
111
112 return manifold;
113 }
114
115 void btCollisionDispatcher::clearManifold(btPersistentManifold* manifold)
116 {
117 manifold->clearManifold();
118 }
119
120
121 void btCollisionDispatcher::releaseManifold(btPersistentManifold* manifold)
122 {
123
124 gNumManifold--;
125
126 //printf("releaseManifold: gNumManifold %d\n",gNumManifold);
127 clearManifold(manifold);
128
129 int findIndex = manifold->m_index1a;
130 btAssert(findIndex < m_manifoldsPtr.size());
131 m_manifoldsPtr.swap(findIndex,m_manifoldsPtr.size()-1);
132 m_manifoldsPtr[findIndex]->m_index1a = findIndex;
133 m_manifoldsPtr.pop_back();
134
135 manifold->~btPersistentManifold();
136 if (m_persistentManifoldPoolAllocator->validPtr(manifold))
137 {
138 m_persistentManifoldPoolAllocator->freeMemory(manifold);
139 } else
140 {
141 btAlignedFree(manifold);
142 }
143
144 }
145
146
147
148
149 btCollisionAlgorithm* btCollisionDispatcher::findAlgorithm(const btCollisionObjectWrapper* body0Wrap,const btCollisionObjectWrapper* body1Wrap,btPersistentManifold* sharedManifold, ebtDispatcherQueryType algoType)
150 {
151
152 btCollisionAlgorithmConstructionInfo ci;
153
154 ci.m_dispatcher1 = this;
155 ci.m_manifold = sharedManifold;
156 btCollisionAlgorithm* algo = 0;
157 if (algoType == BT_CONTACT_POINT_ALGORITHMS)
158 {
159 algo = m_doubleDispatchContactPoints[body0Wrap->getCollisionShape()->getShapeType()][body1Wrap->getCollisionShape()->getShapeType()]->CreateCollisionAlgorithm(ci, body0Wrap, body1Wrap);
160 }
161 else
162 {
163 algo = m_doubleDispatchClosestPoints[body0Wrap->getCollisionShape()->getShapeType()][body1Wrap->getCollisionShape()->getShapeType()]->CreateCollisionAlgorithm(ci, body0Wrap, body1Wrap);
164 }
165
166 return algo;
167 }
168
169
170
171
172 bool btCollisionDispatcher::needsResponse(const btCollisionObject* body0,const btCollisionObject* body1)
173 {
174 //here you can do filtering
175 bool hasResponse =
176 (body0->hasContactResponse() && body1->hasContactResponse());
177 //no response between two static/kinematic bodies:
178 hasResponse = hasResponse &&
179 ((!body0->isStaticOrKinematicObject()) ||(! body1->isStaticOrKinematicObject()));
180 return hasResponse;
181 }
182
183 bool btCollisionDispatcher::needsCollision(const btCollisionObject* body0,const btCollisionObject* body1)
184 {
185 btAssert(body0);
186 btAssert(body1);
187
188 bool needsCollision = true;
189
190 #ifdef BT_DEBUG
191 if (!(m_dispatcherFlags & btCollisionDispatcher::CD_STATIC_STATIC_REPORTED))
192 {
193 //broadphase filtering already deals with this
194 if (body0->isStaticOrKinematicObject() && body1->isStaticOrKinematicObject())
195 {
196 m_dispatcherFlags |= btCollisionDispatcher::CD_STATIC_STATIC_REPORTED;
197 printf("warning btCollisionDispatcher::needsCollision: static-static collision!\n");
198 }
199 }
200 #endif //BT_DEBUG
201
202 if ((!body0->isActive()) && (!body1->isActive()))
203 needsCollision = false;
204 else if ((!body0->checkCollideWith(body1)) || (!body1->checkCollideWith(body0)))
205 needsCollision = false;
206
207 return needsCollision ;
208
209 }
210
211
212
215 class btCollisionPairCallback : public btOverlapCallback
216 {
217 const btDispatcherInfo& m_dispatchInfo;
218 btCollisionDispatcher* m_dispatcher;
219
220 public:
221
222 btCollisionPairCallback(const btDispatcherInfo& dispatchInfo,btCollisionDispatcher* dispatcher)
223 :m_dispatchInfo(dispatchInfo),
224 m_dispatcher(dispatcher)
225 {
226 }
227
228 /*btCollisionPairCallback& operator=(btCollisionPairCallback& other)
229 {
230 m_dispatchInfo = other.m_dispatchInfo;
231 m_dispatcher = other.m_dispatcher;
232 return *this;
233 }
234 */
235
236
237 virtual ~btCollisionPairCallback() {}
238
239
240 virtual bool processOverlap(btBroadphasePair& pair)
241 {
242 (*m_dispatcher->getNearCallback())(pair,*m_dispatcher,m_dispatchInfo);
243 return false;
244 }
245 };
246
247
248
249 void btCollisionDispatcher::dispatchAllCollisionPairs(btOverlappingPairCache* pairCache,const btDispatcherInfo& dispatchInfo,btDispatcher* dispatcher)
250 {
251 //m_blockedForChanges = true;
252
253 btCollisionPairCallback collisionCallback(dispatchInfo,this);
254
255 pairCache->processAllOverlappingPairs(&collisionCallback,dispatcher);
256
257 //m_blockedForChanges = false;
258
259 }
260
261
262
263 //by default, Bullet will use this near callback
264 void btCollisionDispatcher::defaultNearCallback(btBroadphasePair& collisionPair, btCollisionDispatcher& dispatcher, const btDispatcherInfo& dispatchInfo)
265 {
266 btCollisionObject* colObj0 = (btCollisionObject*)collisionPair.m_pProxy0->m_clientObject;
267 btCollisionObject* colObj1 = (btCollisionObject*)collisionPair.m_pProxy1->m_clientObject;
268
269 if (dispatcher.needsCollision(colObj0,colObj1))
270 {
271 btCollisionObjectWrapper obj0Wrap(0,colObj0->getCollisionShape(),colObj0,colObj0->getWorldTransform(),-1,-1);
272 btCollisionObjectWrapper obj1Wrap(0,colObj1->getCollisionShape(),colObj1,colObj1->getWorldTransform(),-1,-1);
273
274
275 //dispatcher will keep algorithms persistent in the collision pair
276 if (!collisionPair.m_algorithm)
277 {
278 collisionPair.m_algorithm = dispatcher.findAlgorithm(&obj0Wrap,&obj1Wrap,0, BT_CONTACT_POINT_ALGORITHMS);
279 }
280
281 if (collisionPair.m_algorithm)
282 {
283 btManifoldResult contactPointResult(&obj0Wrap,&obj1Wrap);
284
285 if (dispatchInfo.m_dispatchFunc == btDispatcherInfo::DISPATCH_DISCRETE)
286 {
287 //discrete collision detection query
288
289 collisionPair.m_algorithm->processCollision(&obj0Wrap,&obj1Wrap,dispatchInfo,&contactPointResult);
290 } else
291 {
292 //continuous collision detection query, time of impact (toi)
293 btScalar toi = collisionPair.m_algorithm->calculateTimeOfImpact(colObj0,colObj1,dispatchInfo,&contactPointResult);
294 if (dispatchInfo.m_timeOfImpact > toi)
295 dispatchInfo.m_timeOfImpact = toi;
296
297 }
298 }
299 }
300
301 }
302
303
304 void* btCollisionDispatcher::allocateCollisionAlgorithm(int size)
305 {
306 void* mem = m_collisionAlgorithmPoolAllocator->allocate( size );
307 if (NULL == mem)
308 {
309 //warn user for overflow?
310 return btAlignedAlloc(static_cast<size_t>(size), 16);
311 }
312 return mem;
313 }
314
315 void btCollisionDispatcher::freeCollisionAlgorithm(void* ptr)
316 {
317 if (m_collisionAlgorithmPoolAllocator->validPtr(ptr))
318 {
319 m_collisionAlgorithmPoolAllocator->freeMemory(ptr);
320 } else
321 {
322 btAlignedFree(ptr);
323 }
324 }
btCollisionAlgorithm::calculateTimeOfImpact
virtual btScalar calculateTimeOfImpact(btCollisionObject *body0, btCollisionObject *body1, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)=0
btCollisionDispatcher::m_collisionConfiguration
btCollisionConfiguration * m_collisionConfiguration
Definition: btCollisionDispatcher.h:64
btDispatcherInfo::DISPATCH_DISCRETE
Definition: btDispatcher.h:34
btCollisionConfiguration::getCollisionAlgorithmPool
virtual btPoolAllocator * getCollisionAlgorithmPool()=0
btPersistentManifold
btPersistentManifold is a contact point cache, it stays persistent as long as objects are overlapping...
Definition: btPersistentManifold.h:55
btAlignedObjectArray::push_back
void push_back(const T &_Val)
Definition: btAlignedObjectArray.h:274
BT_CONTACT_POINT_ALGORITHMS
Definition: btDispatcher.h:69
btOverlapCallback
Definition: btOverlappingPairCache.h:29
btCollisionDispatcher::registerCollisionCreateFunc
void registerCollisionCreateFunc(int proxyType0, int proxyType1, btCollisionAlgorithmCreateFunc *createFunc)
registerCollisionCreateFunc allows registration of custom/alternative collision create functions ...
Definition: btCollisionDispatcher.cpp:64
btCollisionPairCallback::btCollisionPairCallback
btCollisionPairCallback(const btDispatcherInfo &dispatchInfo, btCollisionDispatcher *dispatcher)
Definition: btCollisionDispatcher.cpp:222
btCollisionDispatcher::CD_DISABLE_CONTACTPOOL_DYNAMIC_ALLOCATION
Definition: btCollisionDispatcher.h:73
btCollisionAlgorithm::processCollision
virtual void processCollision(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, const btDispatcherInfo &dispatchInfo, btManifoldResult *resultOut)=0
btCollisionDispatcher::m_dispatcherFlags
int m_dispatcherFlags
Definition: btCollisionDispatcher.h:48
btDispatcherInfo::m_dispatchFunc
int m_dispatchFunc
Definition: btDispatcher.h:55
btCollisionAlgorithmCreateFunc::CreateCollisionAlgorithm
virtual btCollisionAlgorithm * CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo &, const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap)
Definition: btCollisionCreateFunc.h:36
size
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
btCollisionPairCallback::m_dispatchInfo
const btDispatcherInfo & m_dispatchInfo
Definition: btCollisionDispatcher.cpp:217
btAssert
#define btAssert(x)
Definition: btScalar.h:114
btCollisionConfiguration
btCollisionConfiguration allows to configure Bullet collision detection stack allocator size...
Definition: btCollisionConfiguration.h:26
btCollisionDispatcher
btCollisionDispatcher supports algorithms that handle ConvexConvex and ConvexConcave collision pairs...
Definition: btCollisionDispatcher.h:43
btCollisionDispatcher::m_doubleDispatchClosestPoints
btCollisionAlgorithmCreateFunc * m_doubleDispatchClosestPoints[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES]
Definition: btCollisionDispatcher.h:62
btCollisionDispatcher::freeCollisionAlgorithm
virtual void freeCollisionAlgorithm(void *ptr)
Definition: btCollisionDispatcher.cpp:315
btManifoldResult
btManifoldResult is a helper class to manage contact results.
Definition: btManifoldResult.h:39
btPoolAllocator::validPtr
bool validPtr(void *ptr)
Definition: btPoolAllocator.h:89
btCollisionDispatcher::setNearCallback
void setNearCallback(btNearCallback nearCallback)
Definition: btCollisionDispatcher.h:130
btCollisionDispatcher::getNearCallback
btNearCallback getNearCallback() const
Definition: btCollisionDispatcher.h:135
btCollisionObjectWrapper::getCollisionShape
const btCollisionShape * getCollisionShape() const
Definition: btCollisionObjectWrapper.h:40
btCollisionObject::isStaticOrKinematicObject
bool isStaticOrKinematicObject() const
Definition: btCollisionObject.h:205
btAlignedObjectArray::swap
void swap(int index0, int index1)
Definition: btAlignedObjectArray.h:405
btCollisionObject::checkCollideWith
bool checkCollideWith(const btCollisionObject *co) const
Definition: btCollisionObject.h:582
btCollisionDispatcher::releaseManifold
virtual void releaseManifold(btPersistentManifold *manifold)
Definition: btCollisionDispatcher.cpp:121
btOverlappingPairCache.h
btOverlappingPairCache
The btOverlappingPairCache provides an interface for overlapping pair management (add, remove, storage), used by the btBroadphaseInterface broadphases.
Definition: btOverlappingPairCache.h:60
btCollisionDispatcher::needsCollision
virtual bool needsCollision(const btCollisionObject *body0, const btCollisionObject *body1)
Definition: btCollisionDispatcher.cpp:183
btCollisionPairCallback
interface for iterating all overlapping collision pairs, no matter how those pairs are stored (array...
Definition: btCollisionDispatcher.cpp:215
btCollisionConfiguration::getCollisionAlgorithmCreateFunc
virtual btCollisionAlgorithmCreateFunc * getCollisionAlgorithmCreateFunc(int proxyType0, int proxyType1)=0
btCollisionDispatcher::CD_STATIC_STATIC_REPORTED
Definition: btCollisionDispatcher.h:71
btCollisionObject::getWorldTransform
btTransform & getWorldTransform()
Definition: btCollisionObject.h:370
btCollisionDispatcher::defaultNearCallback
static void defaultNearCallback(btBroadphasePair &collisionPair, btCollisionDispatcher &dispatcher, const btDispatcherInfo &dispatchInfo)
Definition: btCollisionDispatcher.cpp:264
btDispatcherInfo::m_timeOfImpact
btScalar m_timeOfImpact
Definition: btDispatcher.h:56
btCollisionPairCallback::processOverlap
virtual bool processOverlap(btBroadphasePair &pair)
Definition: btCollisionDispatcher.cpp:240
btCollisionDispatcher::m_manifoldsPtr
btAlignedObjectArray< btPersistentManifold * > m_manifoldsPtr
Definition: btCollisionDispatcher.h:50
btCollisionAlgorithmCreateFunc
Used by the btCollisionDispatcher to register and create instances for btCollisionAlgorithm.
Definition: btCollisionCreateFunc.h:26
btAlignedFree
#define btAlignedFree(ptr)
Definition: btAlignedAllocator.h:48
btCollisionObject
btCollisionObject can be used to manage collision detection objects.
Definition: btCollisionObject.h:49
btBroadphaseProxy::m_clientObject
void * m_clientObject
Definition: btBroadphaseProxy.h:103
btCollisionConfiguration.h
btCollisionDispatcher::clearManifold
virtual void clearManifold(btPersistentManifold *manifold)
Definition: btCollisionDispatcher.cpp:115
btCollisionObject::hasContactResponse
bool hasContactResponse() const
Definition: btCollisionObject.h:210
btCollisionDispatcher::getNewManifold
virtual btPersistentManifold * getNewManifold(const btCollisionObject *b0, const btCollisionObject *b1)
Definition: btCollisionDispatcher.cpp:78
btCollisionShape::getContactBreakingThreshold
virtual btScalar getContactBreakingThreshold(btScalar defaultContactThresholdFactor) const
Definition: btCollisionShape.cpp:45
btPersistentManifold::m_index1a
int m_index1a
Definition: btPersistentManifold.h:82
btCollisionObjectWrapper.h
btAlignedObjectArray::pop_back
void pop_back()
Definition: btAlignedObjectArray.h:199
MAX_BROADPHASE_COLLISION_TYPES
Definition: btBroadphaseProxy.h:78
btBroadphasePair::m_pProxy1
btBroadphaseProxy * m_pProxy1
Definition: btBroadphaseProxy.h:226
btBroadphasePair::m_algorithm
btCollisionAlgorithm * m_algorithm
Definition: btBroadphaseProxy.h:228
btCollisionObject::getContactProcessingThreshold
btScalar getContactProcessingThreshold() const
Definition: btCollisionObject.h:191
btCollisionShape.h
btPoolAllocator.h
btAlignedObjectArray::size
int size() const
return the number of elements in the array
Definition: btAlignedObjectArray.h:155
btBroadphasePair::m_pProxy0
btBroadphaseProxy * m_pProxy0
Definition: btBroadphaseProxy.h:225
btPersistentManifold::clearManifold
void clearManifold()
Definition: btPersistentManifold.h:216
btCollisionDispatcher::btCollisionDispatcher
btCollisionDispatcher(btCollisionConfiguration *collisionConfiguration)
Definition: btCollisionDispatcher.cpp:37
btCollisionDispatcher.h
btCollisionPairCallback::m_dispatcher
btCollisionDispatcher * m_dispatcher
Definition: btCollisionDispatcher.cpp:218
btQuickprof.h
btCollisionDispatcher::CD_USE_RELATIVE_CONTACT_BREAKING_THRESHOLD
Definition: btCollisionDispatcher.h:72
btCollisionConfiguration::getPersistentManifoldPool
virtual btPoolAllocator * getPersistentManifoldPool()=0
memory pools
btPoolAllocator::allocate
void * allocate(int size)
Definition: btPoolAllocator.h:72
btCollisionDispatcher::m_doubleDispatchContactPoints
btCollisionAlgorithmCreateFunc * m_doubleDispatchContactPoints[MAX_BROADPHASE_COLLISION_TYPES][MAX_BROADPHASE_COLLISION_TYPES]
Definition: btCollisionDispatcher.h:60
btCollisionObject.h
btCollisionDispatcher::dispatchAllCollisionPairs
virtual void dispatchAllCollisionPairs(btOverlappingPairCache *pairCache, const btDispatcherInfo &dispatchInfo, btDispatcher *dispatcher)
Definition: btCollisionDispatcher.cpp:249
btCollisionPairCallback::~btCollisionPairCallback
virtual ~btCollisionPairCallback()
Definition: btCollisionDispatcher.cpp:237
btCollisionDispatcher::m_collisionAlgorithmPoolAllocator
btPoolAllocator * m_collisionAlgorithmPoolAllocator
Definition: btCollisionDispatcher.h:56
btCollisionDispatcher::needsResponse
virtual bool needsResponse(const btCollisionObject *body0, const btCollisionObject *body1)
Definition: btCollisionDispatcher.cpp:172
btAlignedAlloc
#define btAlignedAlloc(size, alignment)
Definition: btAlignedAllocator.h:47
btCollisionShape::getShapeType
int getShapeType() const
Definition: btCollisionShape.h:112
btCollisionObject::isActive
bool isActive() const
Definition: btCollisionObject.h:297
btCollisionAlgorithmConstructionInfo::m_manifold
btPersistentManifold * m_manifold
Definition: btCollisionAlgorithm.h:46
btCollisionDispatcher::~btCollisionDispatcher
virtual ~btCollisionDispatcher()
Definition: btCollisionDispatcher.cpp:74
btCollisionDispatcher::allocateCollisionAlgorithm
virtual void * allocateCollisionAlgorithm(int size)
Definition: btCollisionDispatcher.cpp:304
btDispatcherInfo
Definition: btDispatcher.h:30
btCollisionAlgorithmConstructionInfo::m_dispatcher1
btDispatcher * m_dispatcher1
Definition: btCollisionAlgorithm.h:45
btCollisionConfiguration::getClosestPointsAlgorithmCreateFunc
virtual btCollisionAlgorithmCreateFunc * getClosestPointsAlgorithmCreateFunc(int proxyType0, int proxyType1)=0
btPoolAllocator::freeMemory
void freeMemory(void *ptr)
Definition: btPoolAllocator.h:100
btCollisionAlgorithmConstructionInfo
Definition: btCollisionAlgorithm.h:32
btDispatcher
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
Definition: btDispatcher.h:75
btMin
const T & btMin(const T &a, const T &b)
Definition: btMinMax.h:23
btCollisionAlgorithm
btCollisionAlgorithm is an collision interface that is compatible with the Broadphase and btDispatche...
Definition: btCollisionAlgorithm.h:55
btCollisionDispatcher::m_persistentManifoldPoolAllocator
btPoolAllocator * m_persistentManifoldPoolAllocator
Definition: btCollisionDispatcher.h:58
btOverlappingPairCache::processAllOverlappingPairs
virtual void processAllOverlappingPairs(btOverlapCallback *, btDispatcher *dispatcher)=0
gContactBreakingThreshold
btScalar gContactBreakingThreshold
Definition: btPersistentManifold.cpp:21
btCollisionDispatcher::findAlgorithm
btCollisionAlgorithm * findAlgorithm(const btCollisionObjectWrapper *body0Wrap, const btCollisionObjectWrapper *body1Wrap, btPersistentManifold *sharedManifold, ebtDispatcherQueryType queryType)
Definition: btCollisionDispatcher.cpp:149
btCollisionObjectWrapper
Definition: btCollisionObjectWrapper.h:17
gNumManifold
int gNumManifold
Definition: btCollisionDispatcher.cpp:30
ebtDispatcherQueryType
ebtDispatcherQueryType
Definition: btDispatcher.h:67
btCollisionDispatcher::registerClosestPointsCreateFunc
void registerClosestPointsCreateFunc(int proxyType0, int proxyType1, btCollisionAlgorithmCreateFunc *createFunc)
Definition: btCollisionDispatcher.cpp:69
btScalar
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
Definition: btScalar.h:279
btCollisionObject::getCollisionShape
const btCollisionShape * getCollisionShape() const
Definition: btCollisionObject.h:226
btCollisionAlgorithm.h
btBroadphasePair
The btBroadphasePair class contains a pair of aabb-overlapping objects.
Definition: btBroadphaseProxy.h:185