MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / createBroadphase

Method createBroadphase

examples/OpenCL/broadphase/PairBench.cpp:206–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206void PairBench::createBroadphase(int arraySizeX, int arraySizeY, int arraySizeZ)
207{
208 m_data->m_broadphaseGPU = (allBroadphases[curSelectedBroadphase].m_createFunc)(m_clData->m_clContext, m_clData->m_clDevice, m_clData->m_clQueue);
209
210 int strideInBytes = 9 * sizeof(float);
211 int numVertices = sizeof(cube_vertices) / strideInBytes;
212 int numIndices = sizeof(cube_vertices) / sizeof(int);
213 int shapeId = m_guiHelper->getRenderInterface()->registerShape(&cube_vertices[0], numVertices, cube_indices, numIndices);
214 int group = 1;
215 int mask = 1;
216 int index = TEST_INDEX_OFFSET;
217
218 if (gPairBenchFileName)
219 {
220 //char* fileName = "32006GPUAABBs.txt";
221 char relativeFileName[1024];
222 const char* prefix[] = {"./data/", "../data/", "../../data/", "../../../data/", "../../../../data/"};
223 int prefixIndex = -1;
224 {
225 int numPrefixes = sizeof(prefix) / sizeof(char*);
226
227 for (int i = 0; i < numPrefixes; i++)
228 {
229 FILE* f = 0;
230 sprintf(relativeFileName, "%s%s", prefix[i], gPairBenchFileName);
231 f = fopen(relativeFileName, "rb");
232 if (f)
233 {
234 fseek(f, 0L, SEEK_END);
235 int size = ftell(f);
236 rewind(f);
237 char* buf = (char*)malloc(size);
238
239 int actualReadBytes = 0;
240
241 while (actualReadBytes < size)
242 {
243 int left = size - actualReadBytes;
244 int chunk = 8192;
245 int numPlannedRead = left < chunk ? left : chunk;
246 actualReadBytes += fread(&buf[actualReadBytes], 1, numPlannedRead, f);
247 }
248
249 fclose(f);
250
251 char pattern[1024];
252 pattern[0] = 0x0a;
253 pattern[1] = 0;
254 size_t const patlen = strlen(pattern);
255 size_t patcnt = 0;
256 char* oriptr;
257 char* patloc;
258
259 for (oriptr = buf; (patloc = strstr(oriptr, pattern)); oriptr = patloc + patlen)
260 {
261 if (patloc)
262 {
263 *patloc = 0;

Callers

nothing calls this directly

Calls 11

b3MakeVector4Function · 0.85
b3MakeVector3Function · 0.85
parseFloatFunction · 0.70
registerShapeMethod · 0.45
getRenderInterfaceMethod · 0.45
lengthMethod · 0.45
createLargeProxyMethod · 0.45
createProxyMethod · 0.45
writeTransformsMethod · 0.45
writeAabbsToGpuMethod · 0.45

Tested by

no test coverage detected