MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ aabb() [1/2]

AABB3D MayaFlux::Kinesis::aabb ( std::span< const glm::vec3 >  pts)
inlinenoexcept

Axis-aligned bounding box of a plain position span.

Counterpart of the plain position centroid, for positions already decoded from vertices, for example by Kakshya::VertexInsertion.

Parameters
ptsNon-owning span of positions.
Returns
Tightest box, or AABB3D{zero, zero} for an empty span.

Definition at line 263 of file Morphology.hpp.

264{
265 if (pts.empty())
266 return AABB3D { .min = glm::vec3(0.0F), .max = glm::vec3(0.0F) };
267 constexpr float inf = std::numeric_limits<float>::max();
268 AABB3D box { .min = glm::vec3(inf), .max = glm::vec3(-inf) };
269 for (const auto& p : pts) {
270 box.min = glm::min(box.min, p);
271 box.max = glm::max(box.max, p);
272 }
273 return box;
274}
Axis-aligned bounding box in 3D world space.
Definition Bounds.hpp:188

References MayaFlux::Kinesis::AABB3D::min.