Introduced new scheme for handling mouse events with osgViewer. The new scheme enables robust event handling even when using distortion correction render to texture Cameras.
This commit is contained in:
@@ -122,3 +122,14 @@ void GUIEventAdapter::addTouchPoint(unsigned int id, TouchPhase phase, float x,
|
||||
|
||||
_touchData->addTouchPoint(id, phase, x, y, tapCount);
|
||||
}
|
||||
|
||||
void GUIEventAdapter::copyPointerDataFrom(const osgGA::GUIEventAdapter& sourceEvent)
|
||||
{
|
||||
setGraphicsContext(const_cast<osg::GraphicsContext*>(sourceEvent.getGraphicsContext()));
|
||||
setX(sourceEvent.getX());
|
||||
setY(sourceEvent.getY());
|
||||
setInputRange(sourceEvent.getXmin(), sourceEvent.getYmin(), sourceEvent.getXmax(), sourceEvent.getYmax());
|
||||
setButtonMask(sourceEvent.getButtonMask());
|
||||
setMouseYOrientation(sourceEvent.getMouseYOrientation());
|
||||
setPointerDataList(sourceEvent.getPointerDataList());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user