| 333 | } |
| 334 | |
| 335 | void updateScene () |
| 336 | { |
| 337 | auto & cloth = (collide2::ClothModel &) (*meshes[clothID]); |
| 338 | collide2::updatePositions (cloth, h); |
| 339 | |
| 340 | rtcUpdateGeometryBuffer(rtcGetGeometry(g_scene, clothID), RTC_BUFFER_TYPE_VERTEX, 0); |
| 341 | rtcCommitGeometry(rtcGetGeometry(g_scene, clothID)); |
| 342 | rtcCommitScene(g_scene); |
| 343 | |
| 344 | // sim_collisions.clear(); |
| 345 | double t0 = getSeconds(); |
| 346 | rtcCollide(g_scene,g_scene,CollideFunc,&sim_collisions); |
| 347 | double t1 = getSeconds(); |
| 348 | total_collision_time += t1-t0; |
| 349 | addCollisionConstraints (g_scene); |
| 350 | |
| 351 | collide2::constrainPositions (cloth, h, nIters); |
| 352 | collide2::updateVelocities (cloth, h); |
| 353 | |
| 354 | rtcUpdateGeometryBuffer(rtcGetGeometry(g_scene, clothID), RTC_BUFFER_TYPE_VERTEX, 0); |
| 355 | rtcCommitGeometry(rtcGetGeometry(g_scene, clothID)); |
| 356 | rtcCommitScene(g_scene); |
| 357 | |
| 358 | ++cur_time; |
| 359 | } |
| 360 | |
| 361 | /* task that renders a single screen tile */ |
| 362 | Vec3fa renderPixelStandard(float x, float y, const ISPCCamera& camera) |
no test coverage detected