本文整理汇总了C++中Box3f::getMin方法的典型用法代码示例。如果您正苦于以下问题:C++ Box3f::getMin方法的具体用法?C++ Box3f::getMin怎么用?C++ Box3f::getMin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Box3f
的用法示例。
在下文中一共展示了Box3f::getMin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: intersect
bool Line::intersect( float angle, const Box3f& box ) const
{
if (box.isEmpty()) return false;
const Vec3f &max = box.getMax(), &min = box.getMin();
float fuzz = 0.0;
int i;
if (angle < 0.0)
{
fuzz = - angle;
}
else
{
// Find the farthest point on the bounding box (where the pick
// cone will be largest). The amount of fuzz at this point will
// be the minimum we can use. Expand the box by that amount and
// do an intersection.
double tanA = tan(angle);
for(i = 0; i < 8; i++)
{
Vec3f point(i & 01 ? min[0] : max[0],
i & 02 ? min[1] : max[1],
i & 04 ? min[2] : max[2]);
// how far is point from line origin??
Vec3f diff(point - getPosition());
double thisFuzz = sqrt(diff.dot(diff)) * tanA;
if (thisFuzz > fuzz)
fuzz = float(thisFuzz);
}
}
Box3f fuzzBox = box;
fuzzBox.extendBy(Vec3f(min[0] - fuzz, min[1] - fuzz, min[2] - fuzz));
fuzzBox.extendBy(Vec3f(max[0] + fuzz, max[1] + fuzz, max[2] + fuzz));
Vec3f scratch1, scratch2;
return intersect(fuzzBox, scratch1, scratch2);
}
示例2: circumscribe
void Sphere::circumscribe( const Box3f& box )
{
m_center = 0.5f * (box.getMin() + box.getMax());
m_radius = (box.getMax() - m_center).getLength();
}
示例3:
bool Box3f::operator ==( const Box3f& b2 ) const
{
return ( (getMin() == b2.getMin()) && (getMax() == b2.getMax()) );
}