Merge pull request #37547 from aaronfranke/tau

Use Math_TAU and deg2rad/etc in more places and optimize code
This commit is contained in:
Rémi Verschelde 2021-02-01 20:55:25 +01:00 committed by GitHub
commit d2e1216504
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 149 additions and 130 deletions

View file

@ -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);