本文整理汇总了C++中Bounds::is_infinite方法的典型用法代码示例。如果您正苦于以下问题:C++ Bounds::is_infinite方法的具体用法?C++ Bounds::is_infinite怎么用?C++ Bounds::is_infinite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bounds
的用法示例。
在下文中一共展示了Bounds::is_infinite方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Intersects
bool Frustum::Intersects( const Bounds &bounds ) const {
// Has the frustum planes been built?
if (!initialized_) { ASSERT(false); return false; }
// Are the frustum planes up to date?
if (needs_rebuild_) {
// TODO Warn them!
}
// Null boxes always invisible
if (bounds.is_null()) { return false; }
// Infinite boxes always visible
if (bounds.is_infinite()) { return true; }
// Get center of the box
Vector3 center = bounds.center();
// Get the half-size of the box
Vector3 half = bounds.half_size();
// For each plane, see if all points are on the negative side
// If so, object is not visible
for (int32 plane = 0; plane < 6; ++plane) {
// Skip far plane if infinite view frustum
if ((plane == FRUSTUM_PLANE_FAR) && far_distance_ == 0) {
continue;
}
int32 side = frustum_planes_[plane].Side(center, half);
if (side == Plane::NEGATIVE_SIDE) {
return false;
}
}
return true;
}