Use Math_TAU and deg2rad/rad2deg in more places and optimize code

This commit is contained in:
Aaron Franke
2021-01-09 03:47:14 -05:00
parent 98ccaa1bad
commit 1d5042c9e2
34 changed files with 149 additions and 130 deletions
+3 -3
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);