Show
Ignore:
Timestamp:
03/11/08 13:10:09 (6 years ago)
Author:
robert
Message:

Added extra event handlers to make viewer more functional

Files:
1 modified

Legend:

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

    r7904 r7921  
    1717*/ 
    1818 
    19 #include <osgViewer/Viewer> 
    2019 
    2120#include <osg/Notify> 
     
    3029 
    3130#include <osgGA/TerrainManipulator> 
    32  
    33 #include <osgUtil/Optimizer> 
     31#include <osgGA/StateSetManipulator> 
     32 
     33#include <osgViewer/ViewerEventHandlers> 
     34#include <osgViewer/Viewer> 
     35 
    3436 
    3537#include <iostream> 
     
    213215    else rootnode->setCullCallback(elbc); 
    214216 
    215     // add terrain manipulator 
    216     viewer.setCameraManipulator(new osgGA::TerrainManipulator); 
    217       
     217    // add all the event handlers to the viewer 
     218    { 
     219        // add terrain manipulator 
     220        viewer.setCameraManipulator(new osgGA::TerrainManipulator); 
     221 
     222        // add the state manipulator 
     223        viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); 
     224 
     225        // add the thread model handler 
     226        viewer.addEventHandler(new osgViewer::ThreadingHandler); 
     227 
     228        // add the window size toggle handler 
     229        viewer.addEventHandler(new osgViewer::WindowSizeHandler); 
     230 
     231        // add the stats handler 
     232        viewer.addEventHandler(new osgViewer::StatsHandler); 
     233 
     234        // add the help handler 
     235        viewer.addEventHandler(new osgViewer::HelpHandler(arguments.getApplicationUsage())); 
     236 
     237        // add the record camera path handler 
     238        viewer.addEventHandler(new osgViewer::RecordCameraPathHandler); 
     239 
     240        // add the LOD Scale handler 
     241        viewer.addEventHandler(new osgViewer::LODScaleHandler); 
     242    } 
     243 
    218244    // add a viewport to the viewer and attach the scene graph. 
    219245    viewer.setSceneData( rootnode );