1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

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

This commit is contained in:
Aaron Franke
2020-04-03 05:50:40 -04:00
parent 98ccaa1bad
commit 1d5042c9e2
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);