3 #include "core/geo/overlaps_2d.h" 5 #include "utilities/range.h" 14 std::array<glm::vec2, 2> normals(
const rect& r);
15 std::array<glm::vec2, 4> outline(
const rect& r);
19 bool overlaps(
const rect& rect,
const std::array<glm::vec2, n>& shape) {
20 const auto rect_axes = detail::normals(rect);
21 const auto rect_outline = detail::outline(rect);
22 const auto shape_axes = detail::normals_2d(shape);
23 return detail::overlaps(rect_outline.begin(),
29 detail::overlaps(rect_outline.begin(),
39 inline auto inside(
const geo::rect& a,
const glm::vec2& b) {
40 return glm::all(glm::lessThan(a.get_min(), b)) &&
41 glm::all(glm::lessThan(b, a.get_max()));
Definition: capsule_base.h:9