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 136 of file Morphology.hpp.
137{
138 if (pts.empty())
139 return AABB3D { .
min = glm::vec3(0.0F), .max = glm::vec3(0.0F) };
140 constexpr float inf = std::numeric_limits<float>::max();
141 AABB3D box { .min = glm::vec3(inf), .max = glm::vec3(-inf) };
142 for (const auto& p : pts) {
143 const glm::vec3
q =
static_cast<glm::vec3
>(p.position);
144 box.min = glm::min(box.min,
q);
145 box.max = glm::max(box.max,
q);
146 }
147 return box;
148}
Axis-aligned bounding box in 3D world space.
References MayaFlux::Kinesis::AABB3D::min, and q.