| 461 | } |
| 462 | |
| 463 | int main(int argc, char* argv[]) |
| 464 | { |
| 465 | WorldPtr world = std::make_shared<World>(); |
| 466 | world->addSkeleton(createGround()); |
| 467 | world->addSkeleton(createWall()); |
| 468 | |
| 469 | MyWindow window( |
| 470 | world, |
| 471 | createBall(), |
| 472 | createSoftBody(), |
| 473 | createHybridBody(), |
| 474 | createRigidChain(), |
| 475 | createRigidRing()); |
| 476 | |
| 477 | std::cout << "space bar: simulation on/off" << std::endl; |
| 478 | std::cout << "'1': toss a rigid ball" << std::endl; |
| 479 | std::cout << "'2': toss a soft body" << std::endl; |
| 480 | std::cout << "'3': toss a hybrid soft/rigid body" << std::endl; |
| 481 | std::cout << "'4': toss a rigid chain" << std::endl; |
| 482 | std::cout << "'5': toss a ring of rigid bodies" << std::endl; |
| 483 | |
| 484 | std::cout << "\n'd': delete the oldest object" << std::endl; |
| 485 | std::cout << "'r': toggle randomness" << std::endl; |
| 486 | |
| 487 | std::cout << "\nWarning: Let objects settle before tossing a new one, or the " |
| 488 | "simulation could explode." |
| 489 | << std::endl; |
| 490 | std::cout << " If the simulation freezes, you may need to force quit " |
| 491 | "the application.\n" |
| 492 | << std::endl; |
| 493 | |
| 494 | glutInit(&argc, argv); |
| 495 | window.initWindow(640, 480, "Collisions"); |
| 496 | glutMainLoop(); |
| 497 | } |
nothing calls this directly
no test coverage detected