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

Function openFileDemo

examples/ExampleBrowser/OpenGLExampleBrowser.cpp:427–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425}
426
427void openFileDemo(const char* filename)
428{
429 deleteDemo();
430
431 s_guiHelper = new OpenGLGuiHelper(s_app, sUseOpenGL2);
432 s_guiHelper->setVisualizerFlagCallback(OpenGLExampleBrowserVisualizerFlagCallback);
433
434 s_parameterInterface->removeAllParameters();
435
436 CommonExampleOptions options(s_guiHelper, 1);
437 options.m_fileName = filename;
438 char fullPath[1024];
439 sprintf(fullPath, "%s", filename);
440 b3FileUtils::toLower(fullPath);
441
442 for (int i = 0; i < gFileImporterByExtension.size(); i++)
443 {
444 if (strstr(fullPath, gFileImporterByExtension[i].m_extension.c_str()))
445 {
446 sCurrentDemo = gFileImporterByExtension[i].m_createFunc(options);
447 }
448 }
449
450 if (sCurrentDemo)
451 {
452 sCurrentDemo->initPhysics();
453 sCurrentDemo->resetCamera();
454 }
455}
456
457void selectDemo(int demoIndex)
458{

Callers 1

fileOpenCallbackFunction · 0.85

Calls 7

deleteDemoFunction · 0.85
removeAllParametersMethod · 0.80
c_strMethod · 0.80
sizeMethod · 0.45
initPhysicsMethod · 0.45
resetCameraMethod · 0.45

Tested by

no test coverage detected