当前位置: 首页>>代码示例>>C++>>正文


C++ Polytope::getPlaneList方法代码示例

本文整理汇总了C++中osg::Polytope::getPlaneList方法的典型用法代码示例。如果您正苦于以下问题:C++ Polytope::getPlaneList方法的具体用法?C++ Polytope::getPlaneList怎么用?C++ Polytope::getPlaneList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在osg::Polytope的用法示例。


在下文中一共展示了Polytope::getPlaneList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setPolytope

        void setPolytope(osg::Polytope& polytope, osg::Plane& referencePlane)
        {
            _referencePlane = referencePlane;

            const PlaneMask currentMask = polytope.getCurrentMask();
            PlaneMask selector_mask = 0x1;

            const PlaneList& planeList = polytope.getPlaneList();
            unsigned int numActivePlanes = 0;

            PlaneList::const_iterator itr;
            for(itr=planeList.begin(); itr!=planeList.end(); ++itr)
            {
                if (currentMask&selector_mask) ++numActivePlanes;
                selector_mask <<= 1;
            }

            _plane_mask = 0x0;
            _planes.clear();
            _planes.reserve(numActivePlanes);
            _lines.clear();

            selector_mask=0x1;
            for(itr=planeList.begin(); itr!=planeList.end(); ++itr)
            {
                if (currentMask&selector_mask)
                {
                    _planes.push_back(*itr);
                    _plane_mask <<= 1;
                    _plane_mask |= 0x1;
                }
                selector_mask <<= 1;
            }
        }
开发者ID:151706061,项目名称:OpenSceneGraph,代码行数:34,代码来源:PolytopeIntersector.cpp

示例2: intersects

bool ossimPlanetBoundingBox::intersects(const osg::Polytope& frustum)const
{
   const osg::Polytope::PlaneList& planeList = frustum.getPlaneList();
   unsigned int idx = 0;
   unsigned int ptIdx = 0;
   unsigned int outsideCount    = 0;
   unsigned int upperBound = planeList.size();
   double testValue = 0.0;
   for(; idx < upperBound;++idx)
   {
      const osg::Vec4& plane = planeList[idx].asVec4();
      outsideCount = 0;
      for(ptIdx = 0; ptIdx < 8; ++ptIdx)
      {
         testValue =  (((((double)plane[0])*theCorners[ptIdx][0] +
                         ((double)plane[1])*theCorners[ptIdx][1] +
                         ((double)plane[2])*theCorners[ptIdx][2])) + (double)plane[3]);
         if(testValue >-FLT_EPSILON)
         {
            break;
         }
         else
         {
            ++outsideCount;
         }
      }
      if(outsideCount == 8)
      {
         return false;
      }
   }
   
   return true;
}
开发者ID:loongfee,项目名称:ossim-svn,代码行数:34,代码来源:ossimPlanetBoundingBox.cpp

示例3:

bool
GeoCell::intersects( const osg::Polytope& tope ) const
{
    const osg::Polytope::PlaneList& planes = tope.getPlaneList();
    for( osg::Polytope::PlaneList::const_iterator i = planes.begin(); i != planes.end(); ++i )
    {
        if ( i->intersect( _boundaryPoints ) < 0 )
            return false;
    }
    return true;
}
开发者ID:airwzz999,项目名称:osgearth-for-android,代码行数:11,代码来源:SpatialData.cpp

示例4: defined

bool DebugShadowMap::ViewData::DebugPolytope
( const osg::Polytope & p, const char * name )
{
    bool result = false;
#if defined( _DEBUG    ) || defined( DEBUG )
    if( !name ) name = "";

    osg::Polytope & p_prev = _polytopeMap[ std::string( name ) ];

    result = ( p.getPlaneList() != p_prev.getPlaneList() );

    if( result ) {
        std::cout << "Polytope<" << name
                  << "> size(" << p.getPlaneList().size() << ")"
                  << std::endl;

        if( p.getPlaneList().size() == p_prev.getPlaneList().size() ) {
            for( unsigned i = 0; i < p.getPlaneList().size(); ++i )
            {
                if( p.getPlaneList()[i] != p_prev.getPlaneList()[i] )
                {
                    std::cout << "Plane<" << i
                        << "> ("
                        << p.getPlaneList()[i].asVec4()[0] << ", "
                        << p.getPlaneList()[i].asVec4()[1] << ", "
                        << p.getPlaneList()[i].asVec4()[2] << ", "
                        << p.getPlaneList()[i].asVec4()[3] << ")"
                        << std::endl;
                }
            }
        }
    }

    p_prev = p;
#endif
    return result;
}
开发者ID:3dcl,项目名称:osg,代码行数:37,代码来源:DebugShadowMap.cpp


注:本文中的osg::Polytope::getPlaneList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。