Show
Ignore:
Timestamp:
07/22/14 18:35:28 (17 hours ago)
Author:
robert
Message:

Removed usage of _appliedProgramObjectSet as it's no longer used by OSG applications and was causing a threading crash.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgWidget/ViewerEventHandlers.cpp

    r13041 r13376  
    2222        _wm->setScrollingMotion(gea.getScrollingMotion()); 
    2323 
    24         return (this->*ma)(gea.getX(), gea.getY(), gea.getButton()); 
     24        // osgWidget assumes origin is bottom left of window so make sure mouse coordinate are increaseing y upwards and are scaled to window size. 
     25        float x = (gea.getX()-gea.getXmin())/(gea.getXmax()-gea.getXmin())*static_cast<float>(gea.getWindowWidth()); 
     26        float y = (gea.getY()-gea.getYmin())/(gea.getYmax()-gea.getYmin())*static_cast<float>(gea.getWindowHeight()); 
     27        if (gea.getMouseYOrientation()==osgGA::GUIEventAdapter::Y_INCREASING_DOWNWARDS) y = static_cast<float>(gea.getWindowHeight())-y; 
     28 
     29        //OSG_NOTICE<<"MouseHandler(x="<<x<<", y="<<y<<")"<<std::endl; 
     30 
     31        return (this->*ma)(x, y, gea.getButton()); 
    2532    } 
    2633