From c3e3b79b2cb3e8feacc5da68c6d550fa8e8b3d85 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Thu, 11 Jun 2015 19:31:53 +1000 Subject: [PATCH] n/f/base: add accessor implementations --- noise/fractal/base.ipp | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/noise/fractal/base.ipp b/noise/fractal/base.ipp index 2a96a646..8918f71e 100644 --- a/noise/fractal/base.ipp +++ b/noise/fractal/base.ipp @@ -59,6 +59,15 @@ namespace util { namespace noise { namespace fractal { } + //------------------------------------------------------------------------- + template + constexpr unsigned + base::octaves (void) const + { + return m_octaves; + } + + //------------------------------------------------------------------------- template T @@ -67,7 +76,16 @@ namespace util { namespace noise { namespace fractal { m_H = _h; m_invAH = std::pow (m_amplitude, -m_H); m_invGH = std::pow (m_gain, m_H); - return H; + return m_H; + } + + + //------------------------------------------------------------------------- + template + constexpr T + base::H (void) const + { + return m_H; } @@ -98,6 +116,15 @@ namespace util { namespace noise { namespace fractal { } + //------------------------------------------------------------------------- + template + constexpr T + base::lacunarity (void) const + { + return m_lacunarity; + } + + //------------------------------------------------------------------------- template typename base::seed_t @@ -105,4 +132,13 @@ namespace util { namespace noise { namespace fractal { { return m_basis.seed (_seed); } + + + //------------------------------------------------------------------------- + template + constexpr typename base::seed_t + base::seed (void) const + { + return m_basis.seed (); + } } } }