From 1def1e0d531a330179855be4c7d3109d784fb8bb Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 10 Sep 2005 13:07:08 +0000 Subject: [PATCH] From Joran Jessurun, fix to let the Viewer::computeNearFarPoints function work correctly when used with multiple camera's on one render surface. --- src/osgProducer/Viewer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osgProducer/Viewer.cpp b/src/osgProducer/Viewer.cpp index b49333f21..5633a0507 100644 --- a/src/osgProducer/Viewer.cpp +++ b/src/osgProducer/Viewer.cpp @@ -853,6 +853,9 @@ bool Viewer::computeNearFarPoints(float x,float y,unsigned int cameraNum,osg::Ve float pixel_x,pixel_y; if (computePixelCoords(x,y,cameraNum,pixel_x,pixel_y)) { + pixel_x-=sv->getViewport()->x(); + pixel_y-=sv->getViewport()->y(); + return sv->projectWindowXYIntoObject((int)(pixel_x+0.5f),(int)(pixel_y+0.5f),near_point,far_point); } return false;