From Stephan Huber, * GUIEventAdapter: add support for getting normalized touch points
* MultiTouchTrackball: some code cleanup and support for normalized touch-points * oscdevice: receiving and sending multi-touch-events via the Cursor2D-profile from TUIO * added some documentation
This commit is contained in:
@@ -677,7 +677,17 @@ public:
|
||||
|
||||
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;
|
||||
else
|
||||
return -((getTouchData()->get(ndx).y-_Ymin)/(_Ymax-_Ymin)*2.0f-1.0f);
|
||||
}
|
||||
|
||||
typedef std::vector< osg::ref_ptr<PointerData> > PointerDataList;
|
||||
void setPointerDataList(const PointerDataList& pdl) { _pointerDataList = pdl; }
|
||||
|
||||
@@ -36,9 +36,9 @@ class OSGGA_EXPORT MultiTouchTrackballManipulator : public TrackballManipulator
|
||||
|
||||
protected:
|
||||
|
||||
void handleMultiTouchDrag(GUIEventAdapter::TouchData* now, GUIEventAdapter::TouchData* last, const double eventTimeDelta);
|
||||
void handleMultiTouchDrag(const GUIEventAdapter* now, const GUIEventAdapter* last, const double eventTimeDelta);
|
||||
|
||||
osg::ref_ptr<GUIEventAdapter::TouchData> _lastTouchData;
|
||||
osg::ref_ptr<GUIEventAdapter> _lastEvent;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user