Updated osgstereoimage and osgimpostor to handle the new default

orientation of normalized mouse coords.
This commit is contained in:
Robert Osfield
2003-04-14 18:49:41 +00:00
parent 5df7118d6d
commit deac5b8d4a
3 changed files with 11 additions and 12 deletions

View File

@@ -173,16 +173,16 @@ bool SlideEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIAction
case(osgGA::GUIEventAdapter::DRAG):
case(osgGA::GUIEventAdapter::MOVE):
{
static float px = ea.getX();
static float py = ea.getY();
static float px = ea.getXnormalized();
static float py = ea.getYnormalized();
float dx = ea.getX()-px;
float dy = ea.getY()-py;
float dx = ea.getXnormalized()-px;
float dy = ea.getYnormalized()-py;
px = ea.getX();
py = ea.getY();
px = ea.getXnormalized();
py = ea.getYnormalized();
rotateImage((float)dx/(float)(ea.getXmax()-ea.getXmin()),(float)dy/(float)(ea.getYmax()-ea.getYmin()));
rotateImage(dx,dy);
return true;
}
@@ -267,8 +267,8 @@ void SlideEventHandler::offsetImage(float ds,float dt)
void SlideEventHandler::rotateImage(float rx,float ry)
{
const float scale = 0.5f;
_texmatLeft->setMatrix(_texmatLeft->getMatrix()*osg::Matrix::translate(-rx*scale,ry*scale,0.0f));
_texmatRight->setMatrix(_texmatRight->getMatrix()*osg::Matrix::translate(-rx*scale,ry*scale,0.0f));
_texmatLeft->setMatrix(_texmatLeft->getMatrix()*osg::Matrix::translate(-rx*scale,-ry*scale,0.0f));
_texmatRight->setMatrix(_texmatRight->getMatrix()*osg::Matrix::translate(-rx*scale,-ry*scale,0.0f));
}
void SlideEventHandler::initTexMatrices()