首页 > 代码库 > 添加OSG各种事件处理器

添加OSG各种事件处理器

// add the state manipulator
viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) );

// add the thread model handler
viewer.addEventHandler(new osgViewer::ThreadingHandler);

// add the window size toggle handler
viewer.addEventHandler(new osgViewer::WindowSizeHandler);

// add the stats handler
viewer.addEventHandler(new osgViewer::StatsHandler);

// add the help handler
viewer.addEventHandler(new osgViewer::HelpHandler(arguments.getApplicationUsage()));

// add the record camera path handler
viewer.addEventHandler(new osgViewer::RecordCameraPathHandler);

// add the LOD Scale handler
viewer.addEventHandler(new osgViewer::LODScaleHandler);

// add the screen capture handler
viewer.addEventHandler(new osgViewer::ScreenCaptureHandler);

添加OSG各种事件处理器