- Timestamp:
- 08/31/05 17:04:27 (8 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/examples/osgsimulation/osgsimulation.cpp
r3996 r4487 34 34 #include <osgTerrain/DataSet> 35 35 36 #include <osgSim/OverlayNode> 37 36 38 #include <osgGA/NodeTrackerManipulator> 37 39 … … 290 292 } 291 293 292 osg::ref_ptr<osg::Node> root = createEarth(); 294 // read the scene from the list of file specified commandline args. 295 osg::ref_ptr<osg::Node> root = osgDB::readNodeFiles(arguments); 296 297 if (!root) root = createEarth(); 293 298 294 299 if (!root) return 0; … … 300 305 if (csn) 301 306 { 307 308 bool insertOverlayNode = true; 309 osg::ref_ptr<osgSim::OverlayNode> overlayNode; 310 if (insertOverlayNode) 311 { 312 overlayNode = new osgSim::OverlayNode; 313 for(unsigned int i=0; i<csn->getNumChildren(); ++i) 314 { 315 overlayNode->addChild( csn->getChild(i) ); 316 } 317 318 csn->removeChild(0, csn->getNumChildren()); 319 csn->addChild(overlayNode.get()); 320 } 321 322 302 323 osg::Node* cessna = osgDB::readNodeFile("cessna.osg"); 303 324 if (cessna) … … 319 340 320 341 csn->addChild(mt); 342 343 // if we are using an overaly node, use the cessna subgraph as the overlay subgraph 344 if (overlayNode.valid()) 345 { 346 overlayNode->setOverlaySubgraph(mt); 347 } 321 348 322 349 osgGA::NodeTrackerManipulator* tm = new osgGA::NodeTrackerManipulator; … … 332 359 std::cout<<"Failed to read cessna.osg"<<std::endl; 333 360 } 361 334 362 } 335 363
