23 const auto minCorner =
box.min;
24 const auto maxCorner =
box.max;
27 const std::array<bvh::v2::Vec<T, 3>, 8> corners{
28 Vec3{minCorner[0], minCorner[1], minCorner[2]}, Vec3{minCorner[0], minCorner[1], maxCorner[2]},
29 Vec3{minCorner[0], maxCorner[1], minCorner[2]}, Vec3{minCorner[0], maxCorner[1], maxCorner[2]},
30 Vec3{maxCorner[0], minCorner[1], minCorner[2]}, Vec3{maxCorner[0], minCorner[1], maxCorner[2]},
31 Vec3{maxCorner[0], maxCorner[1], minCorner[2]}, Vec3{maxCorner[0], maxCorner[1], maxCorner[2]}};
34 for (
const auto &corner : corners) {
36 const auto dx = corner[0] - p[0];
38 const auto dy = corner[1] - p[1];
40 const auto dz = corner[2] - p[2];
42 Rmax_sq = std::max(Rmax_sq, R_sq);