summaryrefslogtreecommitdiffstats
path: root/modules/opensimplex/open_simplex_noise.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2020-04-03 05:50:40 -0400
committerAaron Franke <arnfranke@yahoo.com>2021-01-09 03:47:14 -0500
commit1d5042c9e265219dec8da7311879f12ef3ef698b (patch)
tree9456ab509bbcaf26cad8dca32dbe18a3cca9277d /modules/opensimplex/open_simplex_noise.cpp
parent98ccaa1bad97bdb83b2afd6a4df6f7a392745592 (diff)
downloadredot-engine-1d5042c9e265219dec8da7311879f12ef3ef698b.tar.gz
Use Math_TAU and deg2rad/rad2deg in more places and optimize code
Diffstat (limited to 'modules/opensimplex/open_simplex_noise.cpp')
-rw-r--r--modules/opensimplex/open_simplex_noise.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/opensimplex/open_simplex_noise.cpp b/modules/opensimplex/open_simplex_noise.cpp
index e4e2e0613a..a823bcf3b8 100644
--- a/modules/opensimplex/open_simplex_noise.cpp
+++ b/modules/opensimplex/open_simplex_noise.cpp
@@ -131,10 +131,10 @@ Ref<Image> OpenSimplexNoise::get_seamless_image(int p_size) const {
float ii = (float)i / (float)p_size;
float jj = (float)j / (float)p_size;
- ii *= 2.0 * Math_PI;
- jj *= 2.0 * Math_PI;
+ ii *= Math_TAU;
+ jj *= Math_TAU;
- float radius = p_size / (2.0 * Math_PI);
+ float radius = p_size / Math_TAU;
float x = radius * Math::sin(jj);
float y = radius * Math::cos(jj);