本文整理汇总了C++中osg::NodeVisitor::getViewPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeVisitor::getViewPoint方法的具体用法?C++ NodeVisitor::getViewPoint怎么用?C++ NodeVisitor::getViewPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osg::NodeVisitor
的用法示例。
在下文中一共展示了NodeVisitor::getViewPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
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:
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;
}