Show
Ignore:
Timestamp:
05/27/07 16:49:58 (8 years ago)
Author:
robert
Message:

Added option for using the different overlay techniques.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osganimate/osganimate.cpp

    r6052 r6764  
    175175} 
    176176 
    177 osg::Node* createModel(bool overlay) 
     177osg::Node* createModel(bool overlay, osgSim::OverlayNode::OverlayTechnique technique) 
    178178{ 
    179179    osg::Vec3 center(0.0f,0.0f,0.0f); 
     
    187187    if (overlay) 
    188188    { 
    189         osgSim::OverlayNode* overlayNode = new osgSim::OverlayNode; 
     189        osgSim::OverlayNode* overlayNode = new osgSim::OverlayNode(technique); 
    190190        overlayNode->setContinuousUpdate(true); 
    191191        overlayNode->setOverlaySubgraph(movingModel); 
     
    212212    while (arguments.read("--overlay")) overlay = true; 
    213213     
     214    osgSim::OverlayNode::OverlayTechnique technique = osgSim::OverlayNode::OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY; 
     215    while (arguments.read("--object")) { technique = osgSim::OverlayNode::OBJECT_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY; overlay=true; } 
     216    while (arguments.read("--ortho") || arguments.read("--orthographic")) { technique = osgSim::OverlayNode::VIEW_DEPENDENT_WITH_ORTHOGRAPHIC_OVERLAY; overlay=true; } 
     217    while (arguments.read("--persp") || arguments.read("--perspective")) { technique = osgSim::OverlayNode::VIEW_DEPENDENT_WITH_PERSPECTIVE_OVERLAY; overlay=true; } 
     218     
     219 
    214220    // initialize the viewer. 
    215221    osgViewer::Viewer viewer; 
    216222 
    217223    // load the nodes from the commandline arguments. 
    218     osg::Node* model = createModel(overlay); 
     224    osg::Node* model = createModel(overlay, technique); 
    219225    if (!model) 
    220226    {