diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-02-01 20:55:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-01 20:55:25 +0100 |
commit | d2e121650476af0a91bc24ea38253428e97f9695 (patch) | |
tree | 22b120a76f0430faa9e4a9383f7c0c83557616b6 /modules/opensimplex/open_simplex_noise.cpp | |
parent | 264504d76d2c1ea374d5508e6a2634e2b5002d84 (diff) | |
parent | 1d5042c9e265219dec8da7311879f12ef3ef698b (diff) |
Merge pull request #37547 from aaronfranke/tau
Use Math_TAU and deg2rad/etc in more places and optimize code
Diffstat (limited to 'modules/opensimplex/open_simplex_noise.cpp')
-rw-r--r-- | modules/opensimplex/open_simplex_noise.cpp | 6 |
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); |