Added debug messages

This commit is contained in:
Robert Osfield 2007-01-16 17:08:47 +00:00
parent 91a4b0b71d
commit dad3deec38
2 changed files with 12 additions and 1 deletions

View File

@ -213,7 +213,6 @@ struct CompositeViewerCompileOperation : public osg::GraphicsOperation
CompositeViewerCompileOperation():
osg::GraphicsOperation("Compile",false)
{
osg::notify(osg::NOTICE)<<"Constructed CompileOperation"<<std::endl;
}
virtual void operator () (osg::GraphicsContext* context)

View File

@ -447,9 +447,21 @@ bool View::computeIntersections(float x,float y, osgUtil::LineSegmentIntersector
const osg::Camera* camera = getCameraContainingPosition(x, y, local_x, local_y);
if (!camera) camera = _camera.get();
osgUtil::LineSegmentIntersector::CoordinateFrame cf = camera->getViewport() ? osgUtil::Intersector::WINDOW : osgUtil::Intersector::PROJECTION;
osgUtil::LineSegmentIntersector* picker = new osgUtil::LineSegmentIntersector(cf, local_x, local_y);
#if 0
osg::notify(osg::NOTICE)<<"View::computeIntersections(x="<<x<<", y="<<y<<", local_x="<<local_x<<", local_y="<<local_y<<") "<<cf<<std::endl;
osg::notify(osg::NOTICE)<<" viewport ("<<camera->getViewport()->x()<<","<<camera->getViewport()->y()<<","<<camera->getViewport()->width()<<","<<camera->getViewport()->height()<<")"<<std::endl;
const osg::GraphicsContext::Traits* traits = camera->getGraphicsContext() ? camera->getGraphicsContext()->getTraits() : 0;
if (traits)
{
osg::notify(osg::NOTICE)<<" window ("<<traits->x<<","<<traits->y<<","<<traits->width<<","<<traits->height<<")"<<std::endl;
}
#endif
osgUtil::IntersectionVisitor iv(picker);
iv.setTraversalMask(traversalMask);
const_cast<osg::Camera*>(camera)->accept(iv);