- Timestamp:
- 06/01/07 13:21:57 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgsimulation/osgsimulation.cpp
r6787 r6796 196 196 // add the stats handler 197 197 viewer.addEventHandler(new osgViewer::StatsHandler); 198 199 // add the record camera path handler 200 viewer.addEventHandler(new osgViewer::RecordCameraPathHandler); 198 201 199 202 // add the help handler … … 280 283 { 281 284 arguments.getApplicationUsage()->write(std::cout); 282 return 1;283 }284 285 // any option left unread are converted into errors to write out later.286 arguments.reportRemainingOptionsAsUnrecognized();287 288 // report any errors if they have occured when parsing the program aguments.289 if (arguments.errors())290 {291 arguments.writeErrorMessages(std::cout);292 285 return 1; 293 286 } … … 386 379 osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator; 387 380 388 if (tm.valid()) keyswitchManipulator->addMatrixManipulator( '0', "Trackball", tm.get() ); 381 if (tm.valid()) keyswitchManipulator->addMatrixManipulator( '0', "NodeTracker", tm.get() ); 382 389 383 keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() ); 390 384 keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() ); … … 392 386 keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() ); 393 387 388 std::string pathfile; 389 while (arguments.read("-p",pathfile)) 390 { 391 osgGA::AnimationPathManipulator* apm = new osgGA::AnimationPathManipulator(pathfile); 392 if (apm || !apm->valid()) 393 { 394 unsigned int num = keyswitchManipulator->getNumMatrixManipulators(); 395 keyswitchManipulator->addMatrixManipulator( '5', "Path", apm ); 396 keyswitchManipulator->selectMatrixManipulator(num); 397 } 398 } 399 394 400 viewer.setCameraManipulator( keyswitchManipulator.get() ); 395 401 } 396 397 402 398 403 // viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);
