示例#1
0
bool
TileNode::shouldSubDivide(osg::NodeVisitor& nv, const SelectionInfo& selectionInfo, float lodScale)
{
    unsigned currLOD = _key.getLOD();
    if (   currLOD <  selectionInfo.numLods()
        && currLOD != selectionInfo.numLods()-1)
    {
        osg::Vec3 cameraPos = nv.getViewPoint();

        float radius2 = (float)selectionInfo.visParameters(currLOD+1)._visibilityRange2;
        return _surface->anyChildBoxIntersectsSphere(cameraPos, radius2, lodScale);
    }
    return false;
}
示例#2
0
bool
TileNode::shouldSubDivide(osg::NodeVisitor& nv, const SelectionInfo& selectionInfo, float zoomFactor)
{
    unsigned currLOD = _key.getLOD();
    if (   currLOD <  selectionInfo.numLods()
        && currLOD != selectionInfo.numLods()-1)
    {
        osg::Vec3 cameraPos = nv.getViewPoint();

#if OSGEARTH_REX_TILE_NODE_DEBUG_TRAVERSAL
        OE_INFO << LC <<cameraPos.x()<<" "<<cameraPos.y()<<" "<<cameraPos.z()<<" "<<std::endl;
        OE_INFO << LC <<"LOD Scale: "<<fZoomFactor<<std::endl;
#endif  
        float radius = (float)selectionInfo.visParameters(currLOD+1)._fVisibility;
        bool anyChildVisible = _surface->anyChildBoxIntersectsSphere(cameraPos, radius*radius, zoomFactor);
        return anyChildVisible;
    }
    return false;
}