From 6de32b1047d8aa2bb8fe3785d83efa65b17fca85 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sat, 3 Jul 2021 22:26:15 +0300 Subject: [PATCH] Support calling pcg::fractal with geom::point --- libs/pcg/include/psemek/pcg/fractal.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/pcg/include/psemek/pcg/fractal.hpp b/libs/pcg/include/psemek/pcg/fractal.hpp index 446f8732..b112880c 100644 --- a/libs/pcg/include/psemek/pcg/fractal.hpp +++ b/libs/pcg/include/psemek/pcg/fractal.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include @@ -29,6 +30,11 @@ namespace psemek::pcg value_type operator()(geom::vector const & p) const; + value_type operator()(geom::point const & p) const + { + return (*this)(p - p.zero()); + } + private: std::vector octaves; std::vector weights;