本文整理汇总了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;
}
}
示例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;
}
示例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;
}
示例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;
}