summaryrefslogtreecommitdiff
path: root/src/noise.hpp
diff options
context:
space:
mode:
authorCara Salter <cara@devcara.com>2023-01-07 23:24:04 -0500
committerCara Salter <cara@devcara.com>2023-01-07 23:24:04 -0500
commit36d4f4741cd2559362de7e64820ca4b29b022121 (patch)
tree172537aa08f946e2a6dc65bc4bec40985f6e1f95 /src/noise.hpp
downloadcpp-rl-36d4f4741cd2559362de7e64820ca4b29b022121.tar.gz
cpp-rl-36d4f4741cd2559362de7e64820ca4b29b022121.zip
Initial commitHEADmaster
Diffstat (limited to 'src/noise.hpp')
-rw-r--r--src/noise.hpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/noise.hpp b/src/noise.hpp
new file mode 100644
index 0000000..c127e7f
--- /dev/null
+++ b/src/noise.hpp
@@ -0,0 +1,32 @@
+/*
+ * =====================================================================================
+ *
+ * Filename: noise.hpp
+ *
+ * Description: Defining Perlin Noise
+ *
+ * Version: 1.0
+ * Created: 01/07/2023 10:52:51 PM
+ * Revision: none
+ * Compiler: gcc
+ *
+ * Author: Cara Salter (muirrum), cara@devcara.com
+ * Organization:
+ *
+ * =====================================================================================
+ */
+#include <vector>
+#include <stdlib.h>
+
+class PerlinNoise {
+ // permutation vector
+ std::vector<int> p;
+ public:
+ PerlinNoise();
+ PerlinNoise(unsigned int seed);
+ double noise(double x, double y, double z);
+ private:
+ double fade(double t);
+ double lerp(double t, double a, double b);
+ double grad(int hash, double x, double y, double z);
+};