// Copyright (C) 2016 Rémi Bèges // This file is part of the "Nazara Engine - Noise module" // For conditions of distribution and use, see copyright notice in Config.hpp #ifndef NAZARA_NOISEBASE_HPP #define NAZARA_NOISEBASE_HPP #include #include #include #include #include #include #include namespace Nz { class NAZARA_NOISE_API NoiseBase { public: NoiseBase(unsigned int seed = 0); ~NoiseBase() = default; virtual float Get(float x, float y, float scale) const = 0; virtual float Get(float x, float y, float z, float scale) const = 0; virtual float Get(float x, float y, float z, float w, float scale) const = 0; float GetScale(); void SetScale(float scale); void SetSeed(unsigned int seed); void Shuffle(); protected: std::array m_permutations; float m_scale; static std::array s_gradients2; static std::array s_gradients3; static std::array s_gradients4; private: std::default_random_engine m_randomEngine; }; } #endif // NAZARA_NOISEBASE_HPP