summaryrefslogtreecommitdiff
path: root/src/procgen.cpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-12-16 22:41:48 +0000
committerPaweł Redman <pawel.redman@gmail.com>2017-12-16 22:41:48 +0000
commit38edebe4bdeb8caedccf6127a86fddfe9c5808a8 (patch)
tree466cf659201a66a12d922943337e636b5125bccb /src/procgen.cpp
parent5c7d962e605e123e1ce4e0610e8f330b1f4f5e82 (diff)
Fully working nests.
Diffstat (limited to 'src/procgen.cpp')
-rw-r--r--src/procgen.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/procgen.cpp b/src/procgen.cpp
index bfff2c4..a57ed3a 100644
--- a/src/procgen.cpp
+++ b/src/procgen.cpp
@@ -32,6 +32,13 @@ void prng_t::unit_vec(float out[2])
out[1] = sin(t);
}
+v2f_t prng_t::unit_vec2(void)
+{
+ float t;
+ t = next_float() * 2.0f * M_PI;
+ return {cos(t), sin(t)};
+}
+
void perlin_noise_t::generate(prng_t *prng, size_t size_)
{
if (table)