- Timestamp:
- 05/18/07 11:49:30 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgsimulation/osgsimulation.cpp
r6691 r6692 42 42 #include <osgGA/NodeTrackerManipulator> 43 43 #include <osgGA/StateSetManipulator> 44 #include <osgGA/TrackballManipulator> 45 #include <osgGA/FlightManipulator> 46 #include <osgGA/DriveManipulator> 47 #include <osgGA/KeySwitchMatrixManipulator> 48 #include <osgGA/AnimationPathManipulator> 49 #include <osgGA/TerrainManipulator> 44 50 45 51 #include <iostream> … … 295 301 viewer.setSceneData(root.get()); 296 302 303 osg::ref_ptr<osgGA::NodeTrackerManipulator> tm; 304 297 305 osg::CoordinateSystemNode* csn = dynamic_cast<osg::CoordinateSystemNode*>(root.get()); 298 306 if (csn) … … 359 367 } 360 368 361 osgGA::NodeTrackerManipulator*tm = new osgGA::NodeTrackerManipulator;369 tm = new osgGA::NodeTrackerManipulator; 362 370 tm->setTrackerMode(trackerMode); 363 371 tm->setRotationMode(rotationMode); 364 372 tm->setTrackNode(scaler); 365 366 viewer.setCameraManipulator(tm);367 373 } 368 374 else … … 372 378 373 379 } 380 381 382 // set up camera manipulators. 383 { 384 osg::ref_ptr<osgGA::KeySwitchMatrixManipulator> keyswitchManipulator = new osgGA::KeySwitchMatrixManipulator; 385 386 if (tm.valid()) keyswitchManipulator->addMatrixManipulator( '0', "Trackball", tm.get() ); 387 keyswitchManipulator->addMatrixManipulator( '1', "Trackball", new osgGA::TrackballManipulator() ); 388 keyswitchManipulator->addMatrixManipulator( '2', "Flight", new osgGA::FlightManipulator() ); 389 keyswitchManipulator->addMatrixManipulator( '3', "Drive", new osgGA::DriveManipulator() ); 390 keyswitchManipulator->addMatrixManipulator( '4', "Terrain", new osgGA::TerrainManipulator() ); 391 392 viewer.setCameraManipulator( keyswitchManipulator.get() ); 393 } 394 374 395 375 396 viewer.setThreadingModel(osgViewer::Viewer::SingleThreaded);
