| 632 | } |
| 633 | |
| 634 | int main(int argc, char* argv[]) |
| 635 | { |
| 636 | WorldPtr world = std::make_shared<World>(); |
| 637 | world->addSkeleton(createGround()); |
| 638 | world->addSkeleton(createWall()); |
| 639 | |
| 640 | MyWindow window( |
| 641 | world, |
| 642 | createBall(), |
| 643 | createSoftBody(), |
| 644 | createHybridBody(), |
| 645 | createRigidChain(), |
| 646 | createRigidRing()); |
| 647 | |
| 648 | std::cout << "space bar: simulation on/off" << std::endl; |
| 649 | std::cout << "'1': toss a rigid ball" << std::endl; |
| 650 | std::cout << "'2': toss a soft body" << std::endl; |
| 651 | std::cout << "'3': toss a hybrid soft/rigid body" << std::endl; |
| 652 | std::cout << "'4': toss a rigid chain" << std::endl; |
| 653 | std::cout << "'5': toss a ring of rigid bodies" << std::endl; |
| 654 | |
| 655 | std::cout << "\n'd': delete the oldest object" << std::endl; |
| 656 | std::cout << "'r': toggle randomness" << std::endl; |
| 657 | |
| 658 | std::cout << "\nWarning: Let objects settle before tossing a new one, or the " |
| 659 | "simulation could explode." |
| 660 | << std::endl; |
| 661 | std::cout << " If the simulation freezes, you may need to force quit " |
| 662 | "the application.\n" |
| 663 | << std::endl; |
| 664 | |
| 665 | glutInit(&argc, argv); |
| 666 | window.initWindow(640, 480, "Collisions"); |
| 667 | glutMainLoop(); |
| 668 | } |
nothing calls this directly
no test coverage detected