Show
Ignore:
Timestamp:
10/28/05 12:11:12 (9 years ago)
Author:
robert
Message:

Added command line option --overlay to turn on the use of an OverlayNode?.

Files:
1 modified

Legend:

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

    r4506 r4629  
    175175} 
    176176 
    177 osg::Node* createModel() 
     177osg::Node* createModel(bool overlay) 
    178178{ 
    179179    osg::Vec3 center(0.0f,0.0f,0.0f); 
     
    185185    osg::Node* movingModel = createMovingModel(center,radius*0.8f); 
    186186 
    187 #if 1 
    188     osgSim::OverlayNode* overlayNode = new osgSim::OverlayNode; 
    189     overlayNode->setOverlaySubgraph(movingModel); 
    190     overlayNode->addChild(baseModel); 
    191     root->addChild(overlayNode); 
    192 #else 
    193     root->addChild(baseModel); 
    194 #endif 
    195  
     187    if (overlay) 
     188    { 
     189        osgSim::OverlayNode* overlayNode = new osgSim::OverlayNode; 
     190        overlayNode->setContinousUpdate(true); 
     191        overlayNode->setOverlaySubgraph(movingModel); 
     192        overlayNode->addChild(baseModel); 
     193        root->addChild(overlayNode); 
     194    } 
     195    else 
     196    { 
     197     
     198        root->addChild(baseModel); 
     199    } 
     200     
    196201    root->addChild(movingModel); 
    197202 
     
    225230        return 1; 
    226231    } 
     232     
     233    bool overlay = false; 
     234    while (arguments.read("--overlay")) overlay = true; 
    227235 
    228236    // any option left unread are converted into errors to write out later. 
     
    237245     
    238246    // load the nodes from the commandline arguments. 
    239     osg::Node* model = createModel(); 
     247    osg::Node* model = createModel(overlay); 
    240248    if (!model) 
    241249    {