Support calling pcg generators with sequence of coordinates (as opposed to geom::vector)

This commit is contained in:
Nikita Lisitsa 2020-10-03 13:06:17 +03:00
parent b47a95a158
commit 90165b9b59
2 changed files with 13 additions and 0 deletions

View file

@ -17,6 +17,12 @@ namespace psemek::pcg
template <typename Arg>
fractal(std::vector<Arg> args, std::vector<value_type> weights);
template <typename ... Args>
value_type operator ()(Args const & ... args) const
{
return (*this)(geom::vector{args...});
}
value_type operator()(geom::vector<value_type, dimension> const & p) const;
private:

View file

@ -37,6 +37,13 @@ namespace psemek::pcg
return grad_map_.depth() - 1;
}
// Coords \in [0.0 .. 1.0]
template <typename ... Args>
T operator()(Args const & ... args) const
{
return (*this)(geom::vector{args...});
}
// Coords \in [0.0 .. 1.0]
T operator()(geom::vector<T, N> p) const;