Changed Rect('s to Rectangle('s
This commit is contained in:
@@ -152,22 +152,24 @@ EventAdapter* KeyboardMouseCallback::createEventAdapter()
|
|||||||
float minY = FLT_MAX;
|
float minY = FLT_MAX;
|
||||||
float maxX = -FLT_MAX;
|
float maxX = -FLT_MAX;
|
||||||
float maxY = -FLT_MAX;
|
float maxY = -FLT_MAX;
|
||||||
int numInputRectangle = ia->getNumInputRectangle();
|
//int numInputRectangle = ia->getNumInputRectangle();
|
||||||
for (int i=0;i<numInputRectangle;++i)
|
int numRenderSurfaces = ia->getNumRenderSurfaces();
|
||||||
|
for (int i=0;i<numRenderSurfaces;++i)
|
||||||
{
|
{
|
||||||
Producer::InputRectangle* ir = ia->getInputRectangle(i);
|
const Producer::RenderSurface::InputRectangle &ir =
|
||||||
|
ia->getRenderSurface(i)->getInputRectangle();
|
||||||
|
|
||||||
minX = osg::minimum(minX,ir->left());
|
minX = osg::minimum(minX,ir.left());
|
||||||
minX = osg::minimum(minX,ir->left()+ir->width());
|
minX = osg::minimum(minX,ir.left()+ir.width());
|
||||||
|
|
||||||
minY = osg::minimum(minY,ir->bottom());
|
minY = osg::minimum(minY,ir.bottom());
|
||||||
minY = osg::minimum(minY,ir->bottom()+ir->height());
|
minY = osg::minimum(minY,ir.bottom()+ir.height());
|
||||||
|
|
||||||
maxX = osg::maximum(maxX,ir->left());
|
maxX = osg::maximum(maxX,ir.left());
|
||||||
maxX = osg::maximum(maxX,ir->left()+ir->width());
|
maxX = osg::maximum(maxX,ir.left()+ir.width());
|
||||||
|
|
||||||
maxY = osg::maximum(maxY,ir->bottom());
|
maxY = osg::maximum(maxY,ir.bottom());
|
||||||
maxY = osg::maximum(maxY,ir->bottom()+ir->height());
|
maxY = osg::maximum(maxY,ir.bottom()+ir.height());
|
||||||
}
|
}
|
||||||
ea->setWindowSize(minX,minY,maxX,maxY);
|
ea->setWindowSize(minX,minY,maxX,maxY);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ void OsgSceneHandler::cullImplementation(Producer::Camera &cam)
|
|||||||
|
|
||||||
int x, y;
|
int x, y;
|
||||||
unsigned int w, h;
|
unsigned int w, h;
|
||||||
cam.getProjectionRect( x, y, w, h );
|
cam.getProjectionRectangle( x, y, w, h );
|
||||||
|
|
||||||
setViewport( x, y, w, h );
|
setViewport( x, y, w, h );
|
||||||
|
|
||||||
|
|||||||
@@ -422,11 +422,11 @@ bool Viewer::computePixelCoords(float x,float y,unsigned int cameraNum,float& pi
|
|||||||
|
|
||||||
int pr_wx, pr_wy;
|
int pr_wx, pr_wy;
|
||||||
unsigned int pr_width, pr_height;
|
unsigned int pr_width, pr_height;
|
||||||
camera->getProjectionRect( pr_wx, pr_wy, pr_width, pr_height );
|
camera->getProjectionRectangle( pr_wx, pr_wy, pr_width, pr_height );
|
||||||
|
|
||||||
int rs_wx, rs_wy;
|
int rs_wx, rs_wy;
|
||||||
unsigned int rs_width, rs_height;
|
unsigned int rs_width, rs_height;
|
||||||
rs->getWindowRect( rs_wx, rs_wy, rs_width, rs_height );
|
rs->getWindowRectangle( rs_wx, rs_wy, rs_width, rs_height );
|
||||||
|
|
||||||
pixel_x -= (float)rs_wx;
|
pixel_x -= (float)rs_wx;
|
||||||
pixel_y -= (float)rs_wy;
|
pixel_y -= (float)rs_wy;
|
||||||
@@ -469,7 +469,7 @@ bool Viewer::computeIntersections(float x,float y,unsigned int cameraNum,osgUtil
|
|||||||
|
|
||||||
int pr_wx, pr_wy;
|
int pr_wx, pr_wy;
|
||||||
unsigned int pr_width, pr_height;
|
unsigned int pr_width, pr_height;
|
||||||
camera->getProjectionRect( pr_wx, pr_wy, pr_width, pr_height );
|
camera->getProjectionRectangle( pr_wx, pr_wy, pr_width, pr_height );
|
||||||
|
|
||||||
// convert into clip coords.
|
// convert into clip coords.
|
||||||
float rx = 2.0f*(pixel_x - (float)pr_wx)/(float)pr_width-1.0f;
|
float rx = 2.0f*(pixel_x - (float)pr_wx)/(float)pr_width-1.0f;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public:
|
|||||||
|
|
||||||
int x,y;
|
int x,y;
|
||||||
unsigned int width,height;
|
unsigned int width,height;
|
||||||
camera.getProjectionRect(x,y,width,height);
|
camera.getProjectionRectangle(x,y,width,height);
|
||||||
|
|
||||||
osg::ref_ptr<osg::Image> image = new osg::Image;
|
osg::ref_ptr<osg::Image> image = new osg::Image;
|
||||||
image->readPixels(x,y,width,height,
|
image->readPixels(x,y,width,height,
|
||||||
@@ -134,7 +134,7 @@ void ViewerEventHandler::StatsAndHelpDrawCallback::operator()( const Producer::C
|
|||||||
|
|
||||||
int x,y;
|
int x,y;
|
||||||
unsigned int width,height;
|
unsigned int width,height;
|
||||||
camera.getProjectionRect(x,y,width,height);
|
camera.getProjectionRectangle(x,y,width,height);
|
||||||
_viewport->setViewport(x,y,width,height);
|
_viewport->setViewport(x,y,width,height);
|
||||||
|
|
||||||
OsgSceneHandler* osh = _veh->getOsgCameraGroup()->getSceneHandlerList()[_cameraNumber].get();
|
OsgSceneHandler* osh = _veh->getOsgCameraGroup()->getSceneHandlerList()[_cameraNumber].get();
|
||||||
@@ -785,7 +785,7 @@ bool ViewerEventHandler::handle(const osgGA::GUIEventAdapter& ea,osgGA::GUIActio
|
|||||||
|
|
||||||
if (_firstTimeTogglingFullScreen && rs->isFullScreen())
|
if (_firstTimeTogglingFullScreen && rs->isFullScreen())
|
||||||
{
|
{
|
||||||
rs->setWindowRect(240,220,800,600);
|
rs->setWindowRectangle(240,220,800,600);
|
||||||
rs->useBorder(true);
|
rs->useBorder(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user