/** * Perlin Noise implementation for the ground (header file) **/ #pragma once #include "Implicit.hpp" #include #include #include #include class PerlinNoise : public ImplicitSurface { std::vector p; public: PerlinNoise(); PerlinNoise(unsigned int seed); double operator() (double _x, double _y, double _z) const; double noise(double x, double y) const; Point normal_vector(double x, double y); virtual Point location_hint() const; Point location_hint(double x, double z) const; private: double noise(double x, double y, double z) const; double fade(double t) const; double lerp(double t, double a, double b) const; double grad(int hash, double x, double y, double z) const; };