MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/PositionBasedDynamics / main

Function main

Demos/CosseratRodsDemo/main.cpp:43–83  ·  view source on GitHub ↗

main

Source from the content-addressed store, hash-verified

41
42// main
43int main( int argc, char **argv )
44{
45 REPORT_MEMORY_LEAKS
46
47 base = new DemoBase();
48 base->init(argc, argv, "Cosserat rods demo");
49
50 SimulationModel *model = new SimulationModel();
51 model->init();
52 Simulation::getCurrent()->setModel(model);
53
54 buildModel();
55
56 base->createParameterGUI();
57
58 // add additional parameter just for this demo
59 imguiParameters::imguiBoolParameter* param = new imguiParameters::imguiBoolParameter();
60 param->description = "Draw frames";
61 param->label = "Draw frames";
62 param->readOnly = false;
63 param->getFct = []() -> bool { return drawFrames; };
64 param->setFct = [](bool b) -> void { drawFrames = b; };
65 imguiParameters::addParam("Visualization", "Elastic rods", param);
66
67
68 // OpenGL
69 MiniGL::setClientIdleFunc (timeStep);
70 MiniGL::addKeyFunc('r', reset);
71 MiniGL::setClientSceneFunc(render);
72 MiniGL::setViewport (40.0f, 0.1f, 500.0f, Vector3r (5.0, 10.0, 30.0), Vector3r (5.0, 0.0, 0.0));
73 MiniGL::mainLoop ();
74
75 Utilities::Timing::printAverageTimes();
76 Utilities::Timing::printTimeSums();
77
78 delete Simulation::getCurrent();
79 delete base;
80 delete model;
81
82 return 0;
83}
84
85
86void reset()

Callers

nothing calls this directly

Calls 4

setModelMethod · 0.80
buildModelFunction · 0.70
initMethod · 0.45
createParameterGUIMethod · 0.45

Tested by

no test coverage detected