Replies: 3 comments 3 replies
-
I'm not familiar with spnav dirver. Could you provide more details about what libraries you are linking to, and hardware you are using? I do have a gampad style device that I've used with the OSG many yars ago. I used SDL to read from it's joysticks and buttons but didn't attempt to directly push events to the OSG's event handling. Would could take the same approach with the VSG, just leaving how to integrate to 3rd party applications/libs. Another route, would be extending the VSG's event handling is do via a combination of a vsg::UIEvent base class and vsg::Visitor/ConstVisitor to handle the various subclasses from UIEvent. User applications/libraries could subclass from UIEvent but would need to handle the test for the custom UIEvent in the Custom Visitor::apply(EIEvent&). Finally, modifying the VSG itself to add a new UIEvent subclass to handle more sophisticated devices that pointer devices like a mouse/touch/keyboard would open the door to having the Visitor/ConstVisitor classes supported the new event type making it easier to catch those events. I don't have any strong feelings in any direction at this point, the above approaches could do tackle in the above order, as the implementation and experience with it matures closer integration into the core VSG might be appropriate. However, I don't want to start adding new dependencies to the VSG itself, so if we need to link to 3rd party libraries this would be best done via an additional library. It might be that just a vsgExample would suffice if it's straight forward to integrate. |
Beta Was this translation helpful? Give feedback.
-
Here's a link to my device: https://3dconnexion.com/il/product/spacemouse-wireless/ After investigating how FreeCAD supports the device, I found that it interfaces with it through libspnav. It may be found here: https://github.com/FreeSpacenav/libspnav Thanks for your thoughts about how to do the integration. I'm still not following everything you're suggesting though. If there is interest I'll prepare a vsgExample with my current polling solution in the main loop. |
Beta Was this translation helpful? Give feedback.
-
Hello, |
Beta Was this translation helpful? Give feedback.
-
I have written a proof of concept spacemouse (a 6dof mouse/joystick device) support to VulkanSceneGraph through the spnav driver on Linux. I did it by simply interpreting the spnav events and handing them over to
trackball
. It all boils down to the following simple code in the main loop (e.g. of vsgviewer):I'm wondering: Is there any general interest for this code? If so, I need some instructions for how wrap these events "idiomatically". I thought of using a
Visitor
, but it obviously doesn't support the special events from the spnav library.Beta Was this translation helpful? Give feedback.
All reactions