From Stephan Huber, "attached you'll find a proposal for handling multi-touch-events with
osgGA. My approach is to bundle all touchpoints into one custom data structure which is attached to an GUIEventAdapter. The current approach simulates a moving mouse for the first touch-point, so basic manipulators do work, sort of. I created a MultiTouchTrackballManipulator-class, one touch-point does rotate the view, two touch-points pan and zoom the view as known from the iphone or other similar multi-touch-devices. A double-tap (similar to a double-click) resets the manipulator to its home-position. The multi-touch-trackball-implementation is not the best, see it as a first starting point. (there's a demo-video at http://vimeo.com/15017377 )"
This commit is contained in:
@@ -157,6 +157,22 @@ class OSGGA_EXPORT EventQueue : public osg::Referenced
|
||||
|
||||
/** Method for adapting keyboard press events. Note, special keys such as Ctrl/Function keys should be adapted to GUIEventAdapter::KeySymbol mappings, with specified time.*/
|
||||
void keyRelease(int key, double time);
|
||||
|
||||
GUIEventAdapter* touchBegan(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time);
|
||||
GUIEventAdapter* touchBegan(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y) {
|
||||
return touchBegan(id, phase, x, y, getTime());
|
||||
}
|
||||
|
||||
GUIEventAdapter* touchMoved(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, double time);
|
||||
GUIEventAdapter* touchMoved(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y) {
|
||||
return touchMoved(id, phase, x, y, getTime());
|
||||
}
|
||||
|
||||
GUIEventAdapter* touchEnded(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, unsigned int tap_count, double time);
|
||||
GUIEventAdapter* touchEnded(unsigned int id, GUIEventAdapter::TouchPhase phase, float x, float y, unsigned int tap_count) {
|
||||
return touchEnded(id, phase, x, y, tap_count, getTime());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** Method for adapting close window events.*/
|
||||
|
||||
Reference in New Issue
Block a user