Commit bf5c465a authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

Merge branch '549-pan-dependent-on-zoom'

parents 059483bd 3395bf04
......@@ -251,3 +251,12 @@ void WGEZoomTrackballManipulator::fitToScreen( const osg::Camera* camera )
m_zoom = fac;
setCenter( center );
}
bool WGEZoomTrackballManipulator::performMovementMiddleMouseButton( const double eventTimeDelta, const double dx, const double dy )
{
// scale panning based on zoom
float scale = -0.5 * ( _distance / m_zoom ) * getThrowScale( eventTimeDelta );
panModel( dx * scale, dy * scale );
return true;
}
......@@ -144,6 +144,16 @@ private:
*/
bool zoom( const osgGA::GUIEventAdapter& ea, osgGA::GUIActionAdapter& us );
/**
* Performs the middle mouse button click.
* \param eventTimeDelta The delta time of the event
* \param dx The delta x of the mouse.
* \param dy The delta y of the mouse.
* \return true It was performed.
* \return false It was not performed.
*/
virtual bool performMovementMiddleMouseButton( const double eventTimeDelta, const double dx, const double dy );
double m_zoom; //!< Zoom factor.
bool m_allowThrow; //!< Do we want the auto-rotation thingy?
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment