I have a task, where i need to find minimum and maximum height of selected region. To achieve this, i use PolytopeIntersector with constructed Polytope (similar to createPolytope from GeoExtent, but for n edges of polygon, instead of four of extent) and simple use something like this:
osg::ref_ptr<osgUtil::PolytopeIntersector> intersector = new osgUtil::PolytopeIntersector(polytope);
intersector->setPrimitiveMask(osgUtil::PolytopeIntersector::TRIANGLE_PRIMITIVES);
osgUtil::IntersectionVisitor visitor;
visitor.setIntersector(intersector);
_mapNode->getTerrainEngine()->accept(visitor);
if (!intersector->containsIntersections()) {
return;
}
It works fine in most cases, but sometimes height of some intersections was lower than i expected. And I discovered that this is due to the fact that where is some vertical-oriented rectangles between tiles (above real elevation data), and intersector hits them, because they are part of TerrainEngine.
Can i disable them, or atleast mask them for intersector somehow?
Oh, sorry, it was fail from my side about no intersections with REX. It works fine now. Thanks for the hint about different engines.
So that means i can't use this method with MP engine, because of implementation (meshes around tile border, which we can't mask or disable)?