Commit abba38e2 authored by Aaron Grabowy's avatar Aaron Grabowy
Browse files

Added contains(objA, objB) default implementation when vertices_of(objB) is available

parent baf38aeb
......@@ -46,6 +46,19 @@ template <int D, class ScalarT>
return b == o;
}
// default implementation for contains(objA, objB) that works for all convex objB with vertices_of defined
template <class A, class B>
[[nodiscard]] constexpr auto contains(A const& a, B const& b, dont_deduce<typename B::scalar_t> eps = static_cast<typename B::scalar_t>(0)) -> decltype(vertices_of(b), false)
{
for (auto const& vertex : vertices_of(b))
if (!contains(a, vertex, eps))
return false;
return true;
}
// object specific implementations for contains(obj, pos)
template <class ScalarT>
[[nodiscard]] constexpr bool contains(aabb<1, ScalarT> const& b, ScalarT const& o, dont_deduce<ScalarT> eps = ScalarT(0))
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment