From 6c7c35d2dd5177b27e3c2fb37b2385575fa66339 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 15 Sep 2015 21:07:13 +1000 Subject: [PATCH] n/f/hetero: add default offset estimation --- noise/fractal/hetero.hpp | 8 ++++++++ noise/fractal/hetero.ipp | 20 ++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/noise/fractal/hetero.hpp b/noise/fractal/hetero.hpp index 26c5ffed..803a9259 100644 --- a/noise/fractal/hetero.hpp +++ b/noise/fractal/hetero.hpp @@ -37,6 +37,14 @@ namespace util { namespace noise { namespace fractal { static constexpr T DEFAULT_GAIN = 1 / DEFAULT_LACUNARITY; static constexpr T DEFAULT_OFFSET = T(0.7); + hetero (seed_t, + unsigned octaves, + T H, + T frequency, + T lacunarity, + T amplitude, + T gain); + hetero (seed_t, unsigned octaves, T H, diff --git a/noise/fractal/hetero.ipp b/noise/fractal/hetero.ipp index 013b8a53..99315aea 100644 --- a/noise/fractal/hetero.ipp +++ b/noise/fractal/hetero.ipp @@ -22,6 +22,26 @@ namespace util { namespace noise { namespace fractal { /////////////////////////////////////////////////////////////////////////// template + hetero::hetero(seed_t _seed, + unsigned _octaves, + T _H, + T _frequency, + T _lacunarity, + T _amplitude, + T _gain): + hetero (_seed, + _octaves, + _H, + _frequency, + _lacunarity, + _amplitude, + _gain, + -this->basis ().bounds ().min + this->basis ().bounds ().magnitude () / T{2}) + { ; } + + + //------------------------------------------------------------------------- + template hetero::hetero(seed_t _seed, unsigned _octaves, T _H,