MCPcopy Create free account
hub / github.com/dartsim/dart / main

Function main

tutorials/tutorial_collisions_finished/main.cpp:634–668  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632}
633
634int 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}

Callers

nothing calls this directly

Calls 9

createGroundFunction · 0.70
createWallFunction · 0.70
createBallFunction · 0.70
createSoftBodyFunction · 0.70
createHybridBodyFunction · 0.70
createRigidChainFunction · 0.70
createRigidRingFunction · 0.70
addSkeletonMethod · 0.45
initWindowMethod · 0.45

Tested by

no test coverage detected