From Stephan Huber, "attached are some fixes to the osc-plugin and the touch-implementations for iOS and os x and other small bugfixes. These fixes will normalize the orientation of the touch points, and transmitting the touch points over osc via the TUIO-protocol works now more robustly between two osg-applications.

I added a new tag to p3d called forward_touch_event_to_device and renamed the existing forward_event_to_device to forward_mouse_event_to_device. This new tag will transmit touches to the virtual trackpad as touch events. I added the MultitouchTrackball to the p3d-app so zooming and moving a model remotely should now work, if you use forward_touch_event_to_device. I kept (and fixed) forward_mouse_event_to_device for background compatibility, so old presentations works as in previous versions, without the ability to zoom + scale. of course.

forward_touch_event_to_device needs some more testing, (e.g. with image-streams and keystone, afaik there’s no support for touch-events...) but for a first version it works nice.
"
This commit is contained in:
Robert Osfield
2014-01-23 15:37:48 +00:00
parent 09c09628ac
commit a96ad565c7
15 changed files with 368 additions and 145 deletions

View File

@@ -675,13 +675,14 @@ public:
void addTouchPoint(unsigned int id, TouchPhase phase, float x, float y, unsigned int tapCount = 0);
void setTouchData(TouchData* td) { _touchData = td; }
TouchData* getTouchData() const { return _touchData.get(); }
bool isMultiTouchEvent() const { return (_touchData.valid()); }
inline float getTouchPointNormalizedX(unsigned int ndx) const {
return (getTouchData()->get(ndx).x-_Xmin)/(_Xmax-_Xmin)*2.0f-1.0f;
}
inline float getTouchPointNormalizedY(unsigned int ndx) const {
if (_mouseYOrientation==Y_INCREASING_UPWARDS)
return (getTouchData()->get(ndx).y-_Ymin)/(_Ymax-_Ymin)*2.0f-1.0f;

View File

@@ -37,7 +37,8 @@ enum Operation
LOAD,
EVENT,
JUMP,
FORWARD_EVENT
FORWARD_MOUSE_EVENT,
FORWARD_TOUCH_EVENT
};
struct JumpData