n/f/hetero: add default offset estimation

This commit is contained in:
Danny Robson 2015-09-15 21:07:13 +10:00
parent 21b51a5011
commit 6c7c35d2dd
2 changed files with 28 additions and 0 deletions

View File

@ -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,

View File

@ -22,6 +22,26 @@
namespace util { namespace noise { namespace fractal {
///////////////////////////////////////////////////////////////////////////
template <typename T, typename B>
hetero<T,B>::hetero(seed_t _seed,
unsigned _octaves,
T _H,
T _frequency,
T _lacunarity,
T _amplitude,
T _gain):
hetero<T,B> (_seed,
_octaves,
_H,
_frequency,
_lacunarity,
_amplitude,
_gain,
-this->basis ().bounds ().min + this->basis ().bounds ().magnitude () / T{2})
{ ; }
//-------------------------------------------------------------------------
template <typename T, typename B>
hetero<T,B>::hetero(seed_t _seed,
unsigned _octaves,
T _H,