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

Function timeStep

Demos/BarDemo/main.cpp:89–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void timeStep ()
90{
91 const Real pauseAt = base->getValue<Real>(DemoBase::PAUSE_AT);
92 if ((pauseAt > 0.0) && (pauseAt < TimeManager::getCurrent()->getTime()))
93 base->setValue(DemoBase::PAUSE, true);
94
95 if (base->getValue<bool>(DemoBase::PAUSE))
96 return;
97
98 // Simulation code
99 SimulationModel *model = Simulation::getCurrent()->getModel();
100 const unsigned int numSteps = base->getValue<unsigned int>(DemoBase::NUM_STEPS_PER_RENDER);
101 for (unsigned int i = 0; i < numSteps; i++)
102 {
103 START_TIMING("SimStep");
104 Simulation::getCurrent()->getTimeStep()->step(*model);
105 STOP_TIMING_AVG;
106
107 base->step();
108 }
109
110 for (unsigned int i = 0; i < model->getTetModels().size(); i++)
111 {
112 model->getTetModels()[i]->updateMeshNormals(model->getParticles());
113 }
114}
115
116void buildModel ()
117{

Callers

nothing calls this directly

Calls 7

getTimeMethod · 0.80
getModelMethod · 0.80
getTimeStepMethod · 0.80
setValueMethod · 0.45
stepMethod · 0.45
sizeMethod · 0.45
updateMeshNormalsMethod · 0.45

Tested by

no test coverage detected