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

◆ with_polygon()

Element & MayaFlux::Portal::Forma::Element::with_polygon ( std::span< const glm::vec2 >  verts)
inline

Set a polygon containment predicate.

Uses the winding number algorithm, covering both convex and non-convex shapes. Vertices are in NDC, ordered CW or CCW.

bounds_hint is independent — set it separately if a cheap pre-filter is useful for this region.

Definition at line 150 of file Element.hpp.

151 {
153 return *this;
154 }
std::function< bool(glm::vec2)> polygon_bounds(std::span< const glm::vec2 > vertices)
Containment test for a convex or concave polygon.
Definition Bounds.hpp:227
std::function< bool(glm::vec2)> contains
Authoritative containment test in NDC space.
Definition Element.hpp:68