osgUtil::PolytopeIntersector* intersector = new osgUtil::PolytopeIntersector(osgUtil::PolytopeIntersector::BOX); osg::BoundingBox bb(osg::Vec3(0.5, 0.5, 0.5), osg::Vec3(1.5, 1.5, 1.5)); intersector->setVolume(bb); 进行相交测试 osgUtil::IntersectionVisitor iv; ...
IntersectionVisitor:IntersectionVisitor搜索场景图形中与指定几何体相交的节点,而最后的测试工作由Intersector继承类完成。 LineSegmentIntersector:继承自Intersector,用于检测指定线段和场景图形之间的相交情况,并向程序提供查询相交测试结果的函数。 PolytopeIntersector:与LineSegmentIntersector类似,该类用于检测由一系列平面构成的...
关于_intersectorStack 是个求交器的集合,我们在构造的时候将PolytopeIntersector传入后将会被加入到这个集合当中..因此 这将会回到PolytopeIntersector中的intersect函数..因此,我们又得重新打开polytope那个文件咯.. 定位到 osgUtil/PolyIntersector.cpp 第547行.. PolytopeIntersector::intersect 我们可以看到再用 PolytopeP...
2)IntersectionVisitor:IntersectionVisitor类搜索场景图形中与指定几何体相交的节点。而最后相交测试的工作将在Intersector的继承类中完成。 3) lineSegmentIntersector:该类继承自Intersector类,用于检测指定线段和场景图形之间的相交情况,并向程序提供查询相交测试结果的函数。 4)PolytopeIntersector:与LineSegmentIntersector类似...
1. osgUtil::PolytopeIntersector // 详细不同算法实现类 2. osgUtil::IntersectionVisitor //用来遍历节点树的每一个节点 3.osg::Node * mNode; // 你要做相交測试的根节点 先看使用方法: osg::ref_ptr<osgUtil::PolytopeIntersector> intersector = new osgUtil::PolytopeIntersector(osgUtil::Intersector:...
void TestPolytopeIntersector(osg::Camera* pCamera ) { if (!pCamera) { return; } osg::Vec3d ptCenter(50, 0, 0); //构建多面体求交器 osg::ref_ptr<osgUtil::PolytopeIntersector> pPolyIntersector; osg::BoundingBox mBoundBox( ptCenter.x() - 51.0, ...
osgUtil::PolytopeIntersector::Intersection's members to use doubles (osg::Vec3d, instead of osg::Vec3). I could have added #ifdef's there too, but I think it is better to not change the types of stuff in the public interface depending on some preprocessor definition. ...
1.创建并设置PolytopeIntersector,其中的鼠标位置应当使用GUIEventAdapter中经过归一化的数 据。 2.创建IntersectionVisitor对象,并将PolytopeIntersector作为其构造函数的输入参数。 3.由场景图形的根节点加载IntersectionVisitor,一般来说是通过Viewer中的Camera对象, 如下面的代码: iv是一个IntersectionVisitor对象 viewer.get...
1.创建并设置PolytopeIntersector,其中的鼠标位置应当使用GUIEventAdapter中经过归一化的数据。 2.创建IntersectionVisitor对象,并将PolytopeIntersector作为其构造函数的输入参数。 3.由场景图形的根节点加载IntersectionVisitor,一般来说是通过Viewer中的Camera对象,
For my LineSegmentIntersector I have used 3D points in model space, which worked fine when visiting the root of the scene. For the PolytopeIntersector I am unsure how to do this... Only examples I have found so far used either coordinates in projection space or coordinates in window space...