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

Function main

tutorials/tutorial_collisions/main.cpp:463–497  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

461}
462
463int 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}

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