Axis-aligned bounding box of a PositionCarrying span.
Returns AABB3D{zero, zero} for an empty span. No allocation; single linear pass.
- Template Parameters
-
| T | Any type satisfying PositionCarrying. |
- Parameters
-
| pts | Non-owning span of points. |
- Returns
- Tightest AABB enclosing all positions in
pts.
Definition at line 240 of file Morphology.hpp.
241{
242 if (pts.empty())
243 return AABB3D { .
min = glm::vec3(0.0F), .max = glm::vec3(0.0F) };
244 constexpr float inf = std::numeric_limits<float>::max();
245 AABB3D box { .min = glm::vec3(inf), .max = glm::vec3(-inf) };
246 for (const auto& p : pts) {
247 const glm::vec3
q =
static_cast<glm::vec3
>(p.position);
248 box.min = glm::min(box.min,
q);
249 box.max = glm::max(box.max,
q);
250 }
251 return box;
252}
Axis-aligned bounding box in 3D world space.
References MayaFlux::Kinesis::AABB3D::min, and q.