btGpu3DGridBroadphase.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. /*
  2. Bullet Continuous Collision Detection and Physics Library, http://bulletphysics.org
  3. Copyright (C) 2006, 2009 Sony Computer Entertainment Inc.
  4. This software is provided 'as-is', without any express or implied warranty.
  5. In no event will the authors be held liable for any damages arising from the use of this software.
  6. Permission is granted to anyone to use this software for any purpose,
  7. including commercial applications, and to alter it and redistribute it freely,
  8. subject to the following restrictions:
  9. 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.
  10. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  11. 3. This notice may not be removed or altered from any source distribution.
  12. */
  13. ///The 3 following lines include the CPU implementation of the kernels, keep them in this order.
  14. #include "bullet/BulletMultiThreaded/btGpuDefines.h"
  15. #include "bullet/BulletMultiThreaded/btGpuUtilsSharedDefs.h"
  16. #include "bullet/BulletMultiThreaded/btGpuUtilsSharedCode.h"
  17. #include "bullet/LinearMath/btAlignedAllocator.h"
  18. #include "bullet/LinearMath/btQuickprof.h"
  19. #include "bullet/BulletCollision//BroadphaseCollision/btOverlappingPairCache.h"
  20. #include "btGpuDefines.h"
  21. #include "btGpuUtilsSharedDefs.h"
  22. #include "btGpu3DGridBroadphaseSharedDefs.h"
  23. #include "btGpu3DGridBroadphase.h"
  24. #include <string.h> //for memset
  25. #include <stdio.h>
  26. static bt3DGridBroadphaseParams s3DGridBroadphaseParams;
  27. btGpu3DGridBroadphase::btGpu3DGridBroadphase( const btVector3& worldAabbMin,const btVector3& worldAabbMax,
  28. int gridSizeX, int gridSizeY, int gridSizeZ,
  29. int maxSmallProxies, int maxLargeProxies, int maxPairsPerBody,
  30. int maxBodiesPerCell,
  31. btScalar cellFactorAABB) :
  32. btSimpleBroadphase(maxSmallProxies,
  33. // new (btAlignedAlloc(sizeof(btSortedOverlappingPairCache),16)) btSortedOverlappingPairCache),
  34. new (btAlignedAlloc(sizeof(btHashedOverlappingPairCache),16)) btHashedOverlappingPairCache),
  35. m_bInitialized(false),
  36. m_numBodies(0)
  37. {
  38. _initialize(worldAabbMin, worldAabbMax, gridSizeX, gridSizeY, gridSizeZ,
  39. maxSmallProxies, maxLargeProxies, maxPairsPerBody,
  40. maxBodiesPerCell, cellFactorAABB);
  41. }
  42. btGpu3DGridBroadphase::btGpu3DGridBroadphase( btOverlappingPairCache* overlappingPairCache,
  43. const btVector3& worldAabbMin,const btVector3& worldAabbMax,
  44. int gridSizeX, int gridSizeY, int gridSizeZ,
  45. int maxSmallProxies, int maxLargeProxies, int maxPairsPerBody,
  46. int maxBodiesPerCell,
  47. btScalar cellFactorAABB) :
  48. btSimpleBroadphase(maxSmallProxies, overlappingPairCache),
  49. m_bInitialized(false),
  50. m_numBodies(0)
  51. {
  52. _initialize(worldAabbMin, worldAabbMax, gridSizeX, gridSizeY, gridSizeZ,
  53. maxSmallProxies, maxLargeProxies, maxPairsPerBody,
  54. maxBodiesPerCell, cellFactorAABB);
  55. }
  56. btGpu3DGridBroadphase::~btGpu3DGridBroadphase()
  57. {
  58. //btSimpleBroadphase will free memory of btSortedOverlappingPairCache, because m_ownsPairCache
  59. btAssert(m_bInitialized);
  60. _finalize();
  61. }
  62. void btGpu3DGridBroadphase::_initialize( const btVector3& worldAabbMin,const btVector3& worldAabbMax,
  63. int gridSizeX, int gridSizeY, int gridSizeZ,
  64. int maxSmallProxies, int maxLargeProxies, int maxPairsPerBody,
  65. int maxBodiesPerCell,
  66. btScalar cellFactorAABB)
  67. {
  68. // set various paramerers
  69. m_ownsPairCache = true;
  70. m_params.m_gridSizeX = gridSizeX;
  71. m_params.m_gridSizeY = gridSizeY;
  72. m_params.m_gridSizeZ = gridSizeZ;
  73. m_params.m_numCells = m_params.m_gridSizeX * m_params.m_gridSizeY * m_params.m_gridSizeZ;
  74. btVector3 w_org = worldAabbMin;
  75. m_params.m_worldOriginX = w_org.getX();
  76. m_params.m_worldOriginY = w_org.getY();
  77. m_params.m_worldOriginZ = w_org.getZ();
  78. btVector3 w_size = worldAabbMax - worldAabbMin;
  79. m_params.m_cellSizeX = w_size.getX() / m_params.m_gridSizeX;
  80. m_params.m_cellSizeY = w_size.getY() / m_params.m_gridSizeY;
  81. m_params.m_cellSizeZ = w_size.getZ() / m_params.m_gridSizeZ;
  82. m_maxRadius = btMin(btMin(m_params.m_cellSizeX, m_params.m_cellSizeY), m_params.m_cellSizeZ);
  83. m_maxRadius *= btScalar(0.5f);
  84. m_params.m_numBodies = m_numBodies;
  85. m_params.m_maxBodiesPerCell = maxBodiesPerCell;
  86. m_numLargeHandles = 0;
  87. m_maxLargeHandles = maxLargeProxies;
  88. m_maxPairsPerBody = maxPairsPerBody;
  89. m_cellFactorAABB = cellFactorAABB;
  90. m_LastLargeHandleIndex = -1;
  91. btAssert(!m_bInitialized);
  92. // allocate host storage
  93. m_hBodiesHash = new unsigned int[m_maxHandles * 2];
  94. memset(m_hBodiesHash, 0x00, m_maxHandles*2*sizeof(unsigned int));
  95. m_hCellStart = new unsigned int[m_params.m_numCells];
  96. memset(m_hCellStart, 0x00, m_params.m_numCells * sizeof(unsigned int));
  97. m_hPairBuffStartCurr = new unsigned int[m_maxHandles * 2 + 2];
  98. // --------------- for now, init with m_maxPairsPerBody for each body
  99. m_hPairBuffStartCurr[0] = 0;
  100. m_hPairBuffStartCurr[1] = 0;
  101. for(int i = 1; i <= m_maxHandles; i++)
  102. {
  103. m_hPairBuffStartCurr[i * 2] = m_hPairBuffStartCurr[(i-1) * 2] + m_maxPairsPerBody;
  104. m_hPairBuffStartCurr[i * 2 + 1] = 0;
  105. }
  106. //----------------
  107. unsigned int numAABB = m_maxHandles + m_maxLargeHandles;
  108. m_hAABB = new bt3DGrid3F1U[numAABB * 2]; // AABB Min & Max
  109. m_hPairBuff = new unsigned int[m_maxHandles * m_maxPairsPerBody];
  110. memset(m_hPairBuff, 0x00, m_maxHandles * m_maxPairsPerBody * sizeof(unsigned int)); // needed?
  111. m_hPairScan = new unsigned int[m_maxHandles + 1];
  112. m_hPairOut = new unsigned int[m_maxHandles * m_maxPairsPerBody];
  113. // large proxies
  114. // allocate handles buffer and put all handles on free list
  115. m_pLargeHandlesRawPtr = btAlignedAlloc(sizeof(btSimpleBroadphaseProxy) * m_maxLargeHandles, 16);
  116. m_pLargeHandles = new(m_pLargeHandlesRawPtr) btSimpleBroadphaseProxy[m_maxLargeHandles];
  117. m_firstFreeLargeHandle = 0;
  118. {
  119. for (int i = m_firstFreeLargeHandle; i < m_maxLargeHandles; i++)
  120. {
  121. m_pLargeHandles[i].SetNextFree(i + 1);
  122. m_pLargeHandles[i].m_uniqueId = m_maxHandles+2+i;
  123. }
  124. m_pLargeHandles[m_maxLargeHandles - 1].SetNextFree(0);
  125. }
  126. // debug data
  127. m_numPairsAdded = 0;
  128. m_numOverflows = 0;
  129. m_bInitialized = true;
  130. }
  131. void btGpu3DGridBroadphase::_finalize()
  132. {
  133. btAssert(m_bInitialized);
  134. delete [] m_hBodiesHash;
  135. delete [] m_hCellStart;
  136. delete [] m_hPairBuffStartCurr;
  137. delete [] m_hAABB;
  138. delete [] m_hPairBuff;
  139. delete [] m_hPairScan;
  140. delete [] m_hPairOut;
  141. btAlignedFree(m_pLargeHandlesRawPtr);
  142. m_bInitialized = false;
  143. }
  144. void btGpu3DGridBroadphase::calculateOverlappingPairs(btDispatcher* dispatcher)
  145. {
  146. if(m_numHandles <= 0)
  147. {
  148. BT_PROFILE("addLarge2LargePairsToCache");
  149. addLarge2LargePairsToCache(dispatcher);
  150. return;
  151. }
  152. // update constants
  153. setParameters(&m_params);
  154. // prepare AABB array
  155. prepareAABB();
  156. // calculate hash
  157. calcHashAABB();
  158. // sort bodies based on hash
  159. sortHash();
  160. // find start of each cell
  161. findCellStart();
  162. // findOverlappingPairs (small/small)
  163. findOverlappingPairs();
  164. // findOverlappingPairs (small/large)
  165. findPairsLarge();
  166. // add pairs to CPU cache
  167. computePairCacheChanges();
  168. scanOverlappingPairBuff();
  169. squeezeOverlappingPairBuff();
  170. addPairsToCache(dispatcher);
  171. // find and add large/large pairs to CPU cache
  172. addLarge2LargePairsToCache(dispatcher);
  173. return;
  174. }
  175. void btGpu3DGridBroadphase::addPairsToCache(btDispatcher* dispatcher)
  176. {
  177. m_numPairsAdded = 0;
  178. m_numPairsRemoved = 0;
  179. for(int i = 0; i < m_numHandles; i++)
  180. {
  181. unsigned int num = m_hPairScan[i+1] - m_hPairScan[i];
  182. if(!num)
  183. {
  184. continue;
  185. }
  186. unsigned int* pInp = m_hPairOut + m_hPairScan[i];
  187. unsigned int index0 = m_hAABB[i * 2].uw;
  188. btSimpleBroadphaseProxy* proxy0 = &m_pHandles[index0];
  189. for(unsigned int j = 0; j < num; j++)
  190. {
  191. unsigned int indx1_s = pInp[j];
  192. unsigned int index1 = indx1_s & (~BT_3DGRID_PAIR_ANY_FLG);
  193. btSimpleBroadphaseProxy* proxy1;
  194. if(index1 < (unsigned int)m_maxHandles)
  195. {
  196. proxy1 = &m_pHandles[index1];
  197. }
  198. else
  199. {
  200. index1 -= m_maxHandles;
  201. btAssert((index1 >= 0) && (index1 < (unsigned int)m_maxLargeHandles));
  202. proxy1 = &m_pLargeHandles[index1];
  203. }
  204. if(indx1_s & BT_3DGRID_PAIR_NEW_FLG)
  205. {
  206. m_pairCache->addOverlappingPair(proxy0,proxy1);
  207. m_numPairsAdded++;
  208. }
  209. else
  210. {
  211. m_pairCache->removeOverlappingPair(proxy0,proxy1,dispatcher);
  212. m_numPairsRemoved++;
  213. }
  214. }
  215. }
  216. }
  217. btBroadphaseProxy* btGpu3DGridBroadphase::createProxy( const btVector3& aabbMin, const btVector3& aabbMax,int shapeType,void* userPtr ,short int collisionFilterGroup,short int collisionFilterMask, btDispatcher* dispatcher,void* multiSapProxy)
  218. {
  219. btBroadphaseProxy* proxy;
  220. bool bIsLarge = isLargeProxy(aabbMin, aabbMax);
  221. if(bIsLarge)
  222. {
  223. if (m_numLargeHandles >= m_maxLargeHandles)
  224. {
  225. ///you have to increase the cell size, so 'large' proxies become 'small' proxies (fitting a cell)
  226. btAssert(0);
  227. return 0; //should never happen, but don't let the game crash ;-)
  228. }
  229. btAssert((aabbMin[0]<= aabbMax[0]) && (aabbMin[1]<= aabbMax[1]) && (aabbMin[2]<= aabbMax[2]));
  230. int newHandleIndex = allocLargeHandle();
  231. proxy = new (&m_pLargeHandles[newHandleIndex])btSimpleBroadphaseProxy(aabbMin,aabbMax,shapeType,userPtr,collisionFilterGroup,collisionFilterMask,multiSapProxy);
  232. }
  233. else
  234. {
  235. proxy = btSimpleBroadphase::createProxy(aabbMin, aabbMax, shapeType, userPtr, collisionFilterGroup, collisionFilterMask, dispatcher, multiSapProxy);
  236. }
  237. return proxy;
  238. }
  239. void btGpu3DGridBroadphase::destroyProxy(btBroadphaseProxy* proxy, btDispatcher* dispatcher)
  240. {
  241. bool bIsLarge = isLargeProxy(proxy);
  242. if(bIsLarge)
  243. {
  244. btSimpleBroadphaseProxy* proxy0 = static_cast<btSimpleBroadphaseProxy*>(proxy);
  245. freeLargeHandle(proxy0);
  246. m_pairCache->removeOverlappingPairsContainingProxy(proxy,dispatcher);
  247. }
  248. else
  249. {
  250. btSimpleBroadphase::destroyProxy(proxy, dispatcher);
  251. }
  252. return;
  253. }
  254. void btGpu3DGridBroadphase::resetPool(btDispatcher* dispatcher)
  255. {
  256. m_hPairBuffStartCurr[0] = 0;
  257. m_hPairBuffStartCurr[1] = 0;
  258. for(int i = 1; i <= m_maxHandles; i++)
  259. {
  260. m_hPairBuffStartCurr[i * 2] = m_hPairBuffStartCurr[(i-1) * 2] + m_maxPairsPerBody;
  261. m_hPairBuffStartCurr[i * 2 + 1] = 0;
  262. }
  263. }
  264. bool btGpu3DGridBroadphase::isLargeProxy(const btVector3& aabbMin, const btVector3& aabbMax)
  265. {
  266. btVector3 diag = aabbMax - aabbMin;
  267. ///use the bounding sphere radius of this bounding box, to include rotation
  268. btScalar radius = diag.length() * btScalar(0.5f);
  269. radius *= m_cellFactorAABB; // user-defined factor
  270. return (radius > m_maxRadius);
  271. }
  272. bool btGpu3DGridBroadphase::isLargeProxy(btBroadphaseProxy* proxy)
  273. {
  274. return (proxy->getUid() >= (m_maxHandles+2));
  275. }
  276. void btGpu3DGridBroadphase::addLarge2LargePairsToCache(btDispatcher* dispatcher)
  277. {
  278. int i,j;
  279. if (m_numLargeHandles <= 0)
  280. {
  281. return;
  282. }
  283. int new_largest_index = -1;
  284. for(i = 0; i <= m_LastLargeHandleIndex; i++)
  285. {
  286. btSimpleBroadphaseProxy* proxy0 = &m_pLargeHandles[i];
  287. if(!proxy0->m_clientObject)
  288. {
  289. continue;
  290. }
  291. new_largest_index = i;
  292. for(j = i + 1; j <= m_LastLargeHandleIndex; j++)
  293. {
  294. btSimpleBroadphaseProxy* proxy1 = &m_pLargeHandles[j];
  295. if(!proxy1->m_clientObject)
  296. {
  297. continue;
  298. }
  299. btAssert(proxy0 != proxy1);
  300. btSimpleBroadphaseProxy* p0 = getSimpleProxyFromProxy(proxy0);
  301. btSimpleBroadphaseProxy* p1 = getSimpleProxyFromProxy(proxy1);
  302. if(aabbOverlap(p0,p1))
  303. {
  304. if (!m_pairCache->findPair(proxy0,proxy1))
  305. {
  306. m_pairCache->addOverlappingPair(proxy0,proxy1);
  307. }
  308. }
  309. else
  310. {
  311. if(m_pairCache->findPair(proxy0,proxy1))
  312. {
  313. m_pairCache->removeOverlappingPair(proxy0,proxy1,dispatcher);
  314. }
  315. }
  316. }
  317. }
  318. m_LastLargeHandleIndex = new_largest_index;
  319. return;
  320. }
  321. void btGpu3DGridBroadphase::rayTest(const btVector3& rayFrom,const btVector3& rayTo, btBroadphaseRayCallback& rayCallback,const btVector3& aabbMin,const btVector3& aabbMax)
  322. {
  323. btSimpleBroadphase::rayTest(rayFrom, rayTo, rayCallback);
  324. for (int i=0; i <= m_LastLargeHandleIndex; i++)
  325. {
  326. btSimpleBroadphaseProxy* proxy = &m_pLargeHandles[i];
  327. if(!proxy->m_clientObject)
  328. {
  329. continue;
  330. }
  331. rayCallback.process(proxy);
  332. }
  333. }
  334. //
  335. // overrides for CPU version
  336. //
  337. void btGpu3DGridBroadphase::prepareAABB()
  338. {
  339. BT_PROFILE("prepareAABB");
  340. bt3DGrid3F1U* pBB = m_hAABB;
  341. int i;
  342. int new_largest_index = -1;
  343. unsigned int num_small = 0;
  344. for(i = 0; i <= m_LastHandleIndex; i++)
  345. {
  346. btSimpleBroadphaseProxy* proxy0 = &m_pHandles[i];
  347. if(!proxy0->m_clientObject)
  348. {
  349. continue;
  350. }
  351. new_largest_index = i;
  352. pBB->fx = proxy0->m_aabbMin.getX();
  353. pBB->fy = proxy0->m_aabbMin.getY();
  354. pBB->fz = proxy0->m_aabbMin.getZ();
  355. pBB->uw = i;
  356. pBB++;
  357. pBB->fx = proxy0->m_aabbMax.getX();
  358. pBB->fy = proxy0->m_aabbMax.getY();
  359. pBB->fz = proxy0->m_aabbMax.getZ();
  360. pBB->uw = num_small;
  361. pBB++;
  362. num_small++;
  363. }
  364. m_LastHandleIndex = new_largest_index;
  365. new_largest_index = -1;
  366. unsigned int num_large = 0;
  367. for(i = 0; i <= m_LastLargeHandleIndex; i++)
  368. {
  369. btSimpleBroadphaseProxy* proxy0 = &m_pLargeHandles[i];
  370. if(!proxy0->m_clientObject)
  371. {
  372. continue;
  373. }
  374. new_largest_index = i;
  375. pBB->fx = proxy0->m_aabbMin.getX();
  376. pBB->fy = proxy0->m_aabbMin.getY();
  377. pBB->fz = proxy0->m_aabbMin.getZ();
  378. pBB->uw = i + m_maxHandles;
  379. pBB++;
  380. pBB->fx = proxy0->m_aabbMax.getX();
  381. pBB->fy = proxy0->m_aabbMax.getY();
  382. pBB->fz = proxy0->m_aabbMax.getZ();
  383. pBB->uw = num_large + m_maxHandles;
  384. pBB++;
  385. num_large++;
  386. }
  387. m_LastLargeHandleIndex = new_largest_index;
  388. // paranoid checks
  389. btAssert(num_small == m_numHandles);
  390. btAssert(num_large == m_numLargeHandles);
  391. return;
  392. }
  393. void btGpu3DGridBroadphase::setParameters(bt3DGridBroadphaseParams* hostParams)
  394. {
  395. s3DGridBroadphaseParams = *hostParams;
  396. return;
  397. }
  398. void btGpu3DGridBroadphase::calcHashAABB()
  399. {
  400. BT_PROFILE("bt3DGrid_calcHashAABB");
  401. btGpu_calcHashAABB(m_hAABB, m_hBodiesHash, m_numHandles);
  402. return;
  403. }
  404. void btGpu3DGridBroadphase::sortHash()
  405. {
  406. class bt3DGridHashKey
  407. {
  408. public:
  409. unsigned int hash;
  410. unsigned int index;
  411. void quickSort(bt3DGridHashKey* pData, int lo, int hi)
  412. {
  413. int i=lo, j=hi;
  414. bt3DGridHashKey x = pData[(lo+hi)/2];
  415. do
  416. {
  417. while(pData[i].hash > x.hash) i++;
  418. while(x.hash > pData[j].hash) j--;
  419. if(i <= j)
  420. {
  421. bt3DGridHashKey t = pData[i];
  422. pData[i] = pData[j];
  423. pData[j] = t;
  424. i++; j--;
  425. }
  426. } while(i <= j);
  427. if(lo < j) pData->quickSort(pData, lo, j);
  428. if(i < hi) pData->quickSort(pData, i, hi);
  429. }
  430. };
  431. BT_PROFILE("bt3DGrid_sortHash");
  432. bt3DGridHashKey* pHash = (bt3DGridHashKey*)m_hBodiesHash;
  433. pHash->quickSort(pHash, 0, m_numHandles - 1);
  434. return;
  435. }
  436. void btGpu3DGridBroadphase::findCellStart()
  437. {
  438. BT_PROFILE("bt3DGrid_findCellStart");
  439. btGpu_findCellStart(m_hBodiesHash, m_hCellStart, m_numHandles, m_params.m_numCells);
  440. return;
  441. }
  442. void btGpu3DGridBroadphase::findOverlappingPairs()
  443. {
  444. BT_PROFILE("bt3DGrid_findOverlappingPairs");
  445. btGpu_findOverlappingPairs(m_hAABB, m_hBodiesHash, m_hCellStart, m_hPairBuff, m_hPairBuffStartCurr, m_numHandles);
  446. return;
  447. }
  448. void btGpu3DGridBroadphase::findPairsLarge()
  449. {
  450. BT_PROFILE("bt3DGrid_findPairsLarge");
  451. btGpu_findPairsLarge(m_hAABB, m_hBodiesHash, m_hCellStart, m_hPairBuff, m_hPairBuffStartCurr, m_numHandles, m_numLargeHandles);
  452. return;
  453. }
  454. void btGpu3DGridBroadphase::computePairCacheChanges()
  455. {
  456. BT_PROFILE("bt3DGrid_computePairCacheChanges");
  457. btGpu_computePairCacheChanges(m_hPairBuff, m_hPairBuffStartCurr, m_hPairScan, m_hAABB, m_numHandles);
  458. return;
  459. }
  460. void btGpu3DGridBroadphase::scanOverlappingPairBuff()
  461. {
  462. BT_PROFILE("bt3DGrid_scanOverlappingPairBuff");
  463. m_hPairScan[0] = 0;
  464. for(int i = 1; i <= m_numHandles; i++)
  465. {
  466. unsigned int delta = m_hPairScan[i];
  467. m_hPairScan[i] = m_hPairScan[i-1] + delta;
  468. }
  469. return;
  470. }
  471. void btGpu3DGridBroadphase::squeezeOverlappingPairBuff()
  472. {
  473. BT_PROFILE("bt3DGrid_squeezeOverlappingPairBuff");
  474. btGpu_squeezeOverlappingPairBuff(m_hPairBuff, m_hPairBuffStartCurr, m_hPairScan, m_hPairOut, m_hAABB, m_numHandles);
  475. return;
  476. }
  477. #include "btGpu3DGridBroadphaseSharedCode.h"