From ef422f0a86d6200e39a8df92e0d6e54c401326a7 Mon Sep 17 00:00:00 2001 From: Orange Date: Thu, 19 Mar 2026 19:23:39 +0300 Subject: [PATCH] added overload --- include/omath/algorithm/targeting.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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