From Philipp Machler, "We have extended the support for Wacom Tablet devices:

- Mac OS X
  - not only pressure, but tilt and z-rotation is supported now
"
This commit is contained in:
Robert Osfield
2008-04-11 13:28:09 +00:00
parent 6fed4022a6
commit 76e0198007
5 changed files with 74 additions and 6 deletions

View File

@@ -39,6 +39,9 @@ GUIEventAdapter::GUIEventAdapter():
_mx(0.5),
_my(0.5),
_pressure(0.0),
_tiltX(0.0),
_tiltY(0.0),
_rotation(0.0),
_buttonMask(0),
_modKeyMask(0),
_scrollingMotion(SCROLL_NONE),
@@ -66,6 +69,9 @@ GUIEventAdapter::GUIEventAdapter(const GUIEventAdapter& rhs,const osg::CopyOp& c
_mx(rhs._mx),
_my(rhs._my),
_pressure(rhs._pressure),
_tiltX(rhs._tiltX),
_tiltY(rhs._tiltY),
_rotation(rhs._rotation),
_buttonMask(rhs._buttonMask),
_modKeyMask(rhs._modKeyMask),
_scrollingMotion(rhs._scrollingMotion),
@@ -100,3 +106,15 @@ void GUIEventAdapter::setInputRange(float Xmin, float Ymin, float Xmax, float Ym
_Xmax = Xmax;
_Ymax = Ymax;
}
const osg::Matrix GUIEventAdapter::getPenOrientation() const
{
float xRad = osg::DegreesToRadians ( getPenTiltY() );
float yRad = osg::DegreesToRadians ( getPenTiltX() );
float zRad = osg::DegreesToRadians ( getPenRotation() );
osg::Matrix xrot = osg::Matrix::rotate ( xRad, osg::Vec3f(1.0f, 0.0f, 0.0f) );
osg::Matrix yrot = osg::Matrix::rotate ( yRad, osg::Vec3f(0.0f, 0.0f, 1.0f) );
osg::Matrix zrot = osg::Matrix::rotate ( zRad, osg::Vec3f(0.0f, 1.0f, 0.0f) );
return ( zrot * yrot * xrot );
}