|
楼主 |
发表于 2009-4-27 09:20:13
|
显示全部楼层
std::cout<<"第"<<k<<"次的起始坐标是"<<" "<<_beginX<<" "<<_beginY<<" "<<std::endl;
osgUtil:ineSegmentIntersector::Intersections _intersections;
osg::ref_ptr< osgUtil::LineSegmentIntersector > _lineSegmentIntersector = new osgUtil::LineSegmentIntersector(osg::Vec3(_beginX,_beginY,1.0),osg::Vec3(_beginX,_beginY,-1.0));
osgUtil::IntersectionVisitor _iv(_lineSegmentIntersector.get());
_theProjection->accept(_iv);
_intersections=_lineSegmentIntersector->getIntersections();
_intersectionNumber=_intersections.size();
if (_lineSegmentIntersector->containsIntersections())
{
std::cout<<"当坐标为"<<_beginX<<" "<<_beginY<<"产生了交点"<<" "<<std::endl;
}
else
{
std::cout<<"当坐标为"<<_beginX<<" "<<_beginY<<"没有交点"<<" "<<std::endl;
} |
|