osgViewer::Viewer + VR Juggler

34 views
Skip to first unread message

MR

unread,
May 1, 2013, 10:42:39 AM5/1/13
to vrjuggler...@googlegroups.com
Hi all,

I have OSG codes in which I use <osgGA/GUIEventHandler> to handle keyboard events and I want to integrate my codes with VR Juggler.

Example:

MyEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActionAdapter& aa)
osgViewer::Viewer* viewer = dynamic_cast<osgViewer::Viewer*>(&aa);

    switch(ea.getEventType())
    {
    case(osgGA::GUIEventAdapter::KEYDOWN):
        {
            switch(ea.getKey())
            {
            case osgGA::GUIEventAdapter::KEY_Down:
             viewer->getCamera()->setClearColor(osg::Vec4f(1.0f, 1.0f, 1.0f, 1.0f) );
            // do some actions

         ...
viewer.addEventHandler(myMyEventHandlerObject);

Do I need to throw away all codes related to event handling in my OSG codes and use instead gadget::KeyboardMouse::EventQueue like here:
https://groups.google.com/forum/?fromgroups=#!topic/vrjuggler-questions/QxPlgV9umPU

I read also that osgUtil::SceneView class is deprecated and some people using vrj::osg::AppViewer seem to have many issues (shaders, etc.). I am little bit confused if it is working very well.
https://groups.google.com/forum/?fromgroups=#!searchin/vrjuggler-questions/vrj::osg::AppViewer/vrjuggler-questions/7HbKyfM6lVM/6vcvOZPq_u0J

I'd like to have advice if it is better to stay with #include <vrj/Draw/OSG/App.h> as in osgNav.h example or change to new #include <vrj/Draw/OSG/AppViewer.h>.

Thank you,
Maia

 
Reply all
Reply to author
Forward
0 new messages