37 const auto minCorner =
box.min;
38 const auto maxCorner =
box.max;
39 using Vec3 = bvh::v2::Vec<T, 3>;
41 const std::array<bvh::v2::Vec<T, 3>, 8> corners{
42 Vec3{minCorner[0], minCorner[1], minCorner[2]}, Vec3{minCorner[0], minCorner[1], maxCorner[2]},
43 Vec3{minCorner[0], maxCorner[1], minCorner[2]}, Vec3{minCorner[0], maxCorner[1], maxCorner[2]},
44 Vec3{maxCorner[0], minCorner[1], minCorner[2]}, Vec3{maxCorner[0], minCorner[1], maxCorner[2]},
45 Vec3{maxCorner[0], maxCorner[1], minCorner[2]}, Vec3{maxCorner[0], maxCorner[1], maxCorner[2]}};
48 for (
const auto& corner : corners) {
50 const auto dx = corner[0] - p[0];
52 const auto dy = corner[1] - p[1];
54 const auto dz = corner[2] - p[2];
56 Rmax_sq = std::max(Rmax_sq, R_sq);