Show
Ignore:
Timestamp:
04/24/08 18:24:16 (7 years ago)
Author:
robert
Message:

From Wojchiech Lewandowski, add missing setDataVariance(DYNAMIC) and extra event handlers

Files:
1 modified

Legend:

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

    r7648 r8217  
    4141 
    4242#include <osgViewer/Viewer> 
     43#include <osgViewer/ViewerEventHandlers> 
    4344 
    4445#include <iostream> 
     
    6768        virtual void update(osg::NodeVisitor* nv,osg::Drawable* drawable) 
    6869        { 
     70            // OpenThreads::Thread::microSleep( 1000 ); 
     71             
    6972            const osg::FrameStamp* fs = nv->getFrameStamp(); 
    7073            double simulationTime = fs->getSimulationTime(); 
     
    240243        osg::Geometry* polyGeom = new osg::Geometry(); 
    241244 
     245        polyGeom->setName( "PolyGeom" ); 
     246 
     247        polyGeom->setDataVariance( osg::Object::DYNAMIC ); 
    242248        polyGeom->setSupportsDisplayList(false); 
    243249 
     
    280286 
    281287        polyGeom->setTexCoordArray(0,texcoords); 
    282  
    283288 
    284289        osg::Vec4Array* colors = new osg::Vec4Array; 
     
    407412    osgViewer::Viewer viewer(arguments); 
    408413 
     414    // add stats 
     415    viewer.addEventHandler( new osgViewer::StatsHandler() ); 
     416 
     417    // add the record camera path handler 
     418    viewer.addEventHandler(new osgViewer::RecordCameraPathHandler); 
     419 
     420    // add the threading handler 
     421    viewer.addEventHandler( new osgViewer::ThreadingHandler() ); 
     422 
    409423    // if user request help write it out to cout. 
    410424    if (arguments.read("-h") || arguments.read("--help"))