本文整理汇总了C++中BoundingBox::extents方法的典型用法代码示例。如果您正苦于以下问题:C++ BoundingBox::extents方法的具体用法?C++ BoundingBox::extents怎么用?C++ BoundingBox::extents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoundingBox
的用法示例。
在下文中一共展示了BoundingBox::extents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: assert
void DepthComplexity3D::writeRaysSpherical(std::ostream& out, int k) {
assert(_computeGoodRays);
long long unsigned int total = 0;
for(int i = 0 ; i <= k ; ++i) {
const std::vector<Segment> & _rays = goodRays(maximum()-i);
total += _rays.size();
}
out << total << "\n";
/* Simple spherical coordinates
for(int i = 0 ; i <= k ; ++i) {
const std::vector<Segment> & _rays = goodRays(maximum()-i);
std::vector<Segment>::const_iterator ite = _rays.begin();
std::vector<Segment>::const_iterator end = _rays.end();
for (; ite != end; ++ite) {
double a, b, c, d;
double x1 = ite->a.x, x2 = ite->b.x, y1 = ite->a.y, y2 = ite->b.y, z1 = ite->a.z, z2 = ite->b.z;
a = atan2(y1, x1);
b = atan2(z1, sqrt(x1*x1 + y1*y1));
c = atan2(y2, x2);
d = atan2(z2, sqrt(x2*x2 + y2*y2));
out << a << " " << b << " " << c << " " << d << " " << maximum()-i << "\n";
}
}
*/
BoundingBox aabb = _mesh->aabb;
Sphere sph;
sph.center = aabb.center();
sph.radius = aabb.extents().length()/2;
// Coordinates of intersection with bounding sphere
for(int i = 0 ; i <= k ; ++i) {
const std::vector<Segment> & _rays = goodRays(maximum()-i);
std::vector<Segment>::const_iterator ite = _rays.begin();
std::vector<Segment>::const_iterator end = _rays.end();
for (; ite != end; ++ite) {
vec3d f, s;
assert(segmentSphereIntersection3D(*ite,sph,f,s));
f = cartesianToSpherical(f);
s = cartesianToSpherical(s);
out << f.y << " " << f.z << " " << s.y << " " << s.z << " " << maximum()-i << "\n";
}
}
}