Hi,

if anyone needs a workaround here is what I did (normalizing the mouse movement 
myself):


Code:

bool MapManipulator::performMovementLeftMouseButton( const double 
eventTimeDelta, const double dx, const double dy )
{        
    if (disableMovement){
        return false;
    }
    float scale = viewMatrix.getScale()[0];
    osg::Matrixd translation;
    double viewportWidth = 1.0;
    double viewportHeight = 1.0;
    if (camera.valid()){
        viewportWidth = camera->getViewport()->width();
        viewportHeight = camera->getViewport()->height();
    }
    
    double normDx = 2 * (_ga_t0->getX() / viewportWidth - _ga_t1->getX() / 
viewportWidth);
    double normDy = 2 * (_ga_t0->getY() / viewportHeight - _ga_t1->getY() / 
viewportHeight);
    
    GuiLog(riff::DEBUG) << "x: " << _ga_t0->getX() << " xmin: " << 
_ga_t0->getXmin() << " xmax: " << viewportWidth;
    
    viewMatrix = viewMatrix * 
translation.translate(-scale*normDx*viewportWidth, 
-scale*normDy*viewportHeight, 0);
    double desiredAlt = 
altitudoMeter.calculateAltitude(viewMatrix.getTrans()[0], 
viewMatrix.getTrans()[1]) + scaleToAltitude(scale);
    viewMatrix = viewMatrix * 
translation.translate(0,0,desiredAlt-viewMatrix.getTrans()[2]);
    isFollowing = false;
    return true;
}




Thank you!

Cheers,
Łukasz

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=48814#48814





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to