| 570 | | root->addChild(terrainGeode.get()); |
| 571 | | |
| | 570 | if (useOverlay) |
| | 571 | { |
| | 572 | osgSim::OverlayNode* overlayNode = new osgSim::OverlayNode(technique); |
| | 573 | overlayNode->getOrCreateStateSet()->setTextureAttribute(1, new osg::TexEnv(osg::TexEnv::DECAL)); |
| | 574 | |
| | 575 | const osg::BoundingSphere& bs = terrainGeode->getBound(); |
| | 576 | osg::Group* overlaySubgraph = createOverlay(bs.center(), bs.radius()*0.5f); |
| | 577 | overlaySubgraph->addChild(ss.get()); |
| | 578 | overlayNode->setOverlaySubgraph(overlaySubgraph); |
| | 579 | overlayNode->setOverlayTextureSizeHint(1024); |
| | 580 | overlayNode->setOverlayBaseHeight(0.0); |
| | 581 | overlayNode->addChild(terrainGeode.get()); |
| | 582 | |
| | 583 | root->addChild(overlayNode); |
| | 584 | } |
| | 585 | else |
| | 586 | { |
| | 587 | root->addChild(terrainGeode.get()); |
| | 588 | } |
| | 589 | |
| 632 | | while (arguments.read("--object")) technique = osgSim::OverlayNode::OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY; |
| 633 | | while (arguments.read("--ortho") || arguments.read("--orthographic")) technique = osgSim::OverlayNode::VIEW_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY; |
| 634 | | while (arguments.read("--persp") || arguments.read("--perspective")) technique = osgSim::OverlayNode::VIEW_DEPENDENT_WITH_PERSPECTIVE_OVERLAY; |
| | 651 | while (arguments.read("--object")) { useOverlay = true; technique = osgSim::OverlayNode::OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY; } |
| | 652 | while (arguments.read("--ortho") || arguments.read("--orthographic")) { useOverlay = true; technique = osgSim::OverlayNode::VIEW_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY; } |
| | 653 | while (arguments.read("--persp") || arguments.read("--perspective")) { useOverlay = true; technique = osgSim::OverlayNode::VIEW_DEPENDENT_WITH_PERSPECTIVE_OVERLAY; } |