首页 > 代码库 > osg事件处理器osgGA::GUIEventHandler handle

osg事件处理器osgGA::GUIEventHandler handle

bool handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)

   {

       osgViewer::Viewer* viewer = dynamic_cast<osgViewer::Viewer*>(&aa);

}

bool ControlMan::handle(const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& aa)
{

        osgViewer::Viewer* viewer = dynamic_cast<osgViewer::Viewer*>(&aa);//Pick
        switch(ea.getEventType())
        {
        case osgGA::GUIEventAdapter::KEYDOWN:
                {
                        switch(ea.getKey())
                        {
                        case w:
                                {return true;
                                }
                        case s:
                                {
                                        return true;

                                }
                        }
                }
        }

        return false;
}