本文整理汇总了C++中PCPlane::getDistance方法的典型用法代码示例。如果您正苦于以下问题:C++ PCPlane::getDistance方法的具体用法?C++ PCPlane::getDistance怎么用?C++ PCPlane::getDistance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PCPlane
的用法示例。
在下文中一共展示了PCPlane::getDistance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isFullyVisible
/* special function that returns true only when sphere fully fits inside the frustum. */
bool PCZFrustum::isFullyVisible(const Sphere& bound) const
{
// Check originplane if told to
if (mUseOriginPlane)
{
if (mOriginPlane.getDistance(bound.getCenter()) <= bound.getRadius() ||
mOriginPlane.getSide(bound.getCenter()) != Plane::POSITIVE_SIDE)
{
return false;
}
}
// For each extra active culling plane,
// see if the sphere is not on the positive side
// If so, object is not fully visible
PCPlaneList::const_iterator pit = mActiveCullingPlanes.begin();
while ( pit != mActiveCullingPlanes.end() )
{
PCPlane* plane = *pit;
if (plane->getDistance(bound.getCenter()) <= bound.getRadius() ||
plane->getSide(bound.getCenter()) != Plane::POSITIVE_SIDE)
{
return false;
}
pit++;
}
return true;
}
示例2: isVisible
bool PCZFrustum::isVisible( const Sphere & bound) const
{
// Check originplane if told to
if (mUseOriginPlane)
{
Plane::Side side = mOriginPlane.getSide(bound.getCenter());
if (side == Plane::NEGATIVE_SIDE)
{
Real dist = mOriginPlane.getDistance(bound.getCenter());
if (dist > bound.getRadius())
{
return false;
}
}
}
// For each extra active culling plane, see if the entire sphere is on the negative side
// If so, object is not visible
PCPlaneList::const_iterator pit = mActiveCullingPlanes.begin();
while ( pit != mActiveCullingPlanes.end() )
{
PCPlane * plane = *pit;
Plane::Side xside = plane->getSide(bound.getCenter());
if (xside == Plane::NEGATIVE_SIDE)
{
Real dist = plane->getDistance(bound.getCenter());
if (dist > bound.getRadius())
{
return false;
}
}
pit++;
}
return true;
}