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

Function main

pyPBD/examples/cloth_collision.py:169–200  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

167 buildModel()
168
169def main():
170 # Activate logger to output info on the console
171 pbd.Logger.addConsoleSink(pbd.LogLevel.INFO)
172
173 # init OpenGL
174 initGL(1280, 1024)
175 gluLookAt (0, 10, -20, 0, 0, 0, 0, 1, 0)
176 glRotatef(20.0, 0, 1, 0)
177
178 # build simulation model
179 buildModel()
180
181 # start event loop
182 running = True
183 while running:
184 for event in pygame.event.get():
185 if event.type == pygame.QUIT:
186 running = False
187 if event.type == pygame.KEYDOWN:
188 if event.key == pygame.K_r:
189 reset()
190 if event.key == pygame.K_ESCAPE:
191 running = False
192
193 glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)
194 glClearColor(0.3, 0.3, 0.3, 1.0)
195 timeStep()
196 render()
197 pygame.display.flip()
198
199 pygame.quit()
200 pbd.Timing.printAverageTimes()
201
202if __name__ == "__main__":
203 main()

Callers 1

cloth_collision.pyFile · 0.70

Calls 7

initGLFunction · 0.85
printAverageTimesMethod · 0.80
buildModelFunction · 0.70
resetFunction · 0.70
timeStepFunction · 0.70
renderFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected