Support calling pcg generators with sequence of coordinates (as opposed to geom::vector)
This commit is contained in:
parent
b47a95a158
commit
90165b9b59
2 changed files with 13 additions and 0 deletions
|
|
@ -17,6 +17,12 @@ namespace psemek::pcg
|
||||||
template <typename Arg>
|
template <typename Arg>
|
||||||
fractal(std::vector<Arg> args, std::vector<value_type> weights);
|
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;
|
value_type operator()(geom::vector<value_type, dimension> const & p) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,13 @@ namespace psemek::pcg
|
||||||
return grad_map_.depth() - 1;
|
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]
|
// Coords \in [0.0 .. 1.0]
|
||||||
T operator()(geom::vector<T, N> p) const;
|
T operator()(geom::vector<T, N> p) const;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue