diff --git a/include/omath/algorithm/targeting.hpp b/include/omath/algorithm/targeting.hpp index 3c06ea0..dee152e 100644 --- a/include/omath/algorithm/targeting.hpp +++ b/include/omath/algorithm/targeting.hpp @@ -7,6 +7,7 @@ #include #include #include +#include namespace omath::algorithm { @@ -47,4 +48,16 @@ namespace omath::algorithm return best_target; } + template + requires std::is_invocable_r_v, + std::ranges::range_reference_t> + [[nodiscard]] + auto get_closest_target_by_fov(const RangeType& range, const CameraType& camera, + auto get_position, + const std::optional>& filter_func = std::nullopt) + { + return get_closest_target_by_fov( + std::ranges::begin(range), std::ranges::end(range), camera, get_position, filter_func); + } + } // namespace omath::algorithm \ No newline at end of file