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 /core/math/math_funcs.h | |
| parent | 264504d76d2c1ea374d5508e6a2634e2b5002d84 (diff) | |
| parent | 1d5042c9e265219dec8da7311879f12ef3ef698b (diff) | |
| download | redot-engine-d2e121650476af0a91bc24ea38253428e97f9695.tar.gz | |
Merge pull request #37547 from aaronfranke/tau
Use Math_TAU and deg2rad/etc in more places and optimize code
Diffstat (limited to 'core/math/math_funcs.h')
| -rw-r--r-- | core/math/math_funcs.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index c7d24e9c58..267f6a4fe2 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -223,11 +223,11 @@ public: return value; } - static _ALWAYS_INLINE_ double deg2rad(double p_y) { return p_y * Math_PI / 180.0; } - static _ALWAYS_INLINE_ float deg2rad(float p_y) { return p_y * Math_PI / 180.0; } + static _ALWAYS_INLINE_ double deg2rad(double p_y) { return p_y * (Math_PI / 180.0); } + static _ALWAYS_INLINE_ float deg2rad(float p_y) { return p_y * (Math_PI / 180.0); } - static _ALWAYS_INLINE_ double rad2deg(double p_y) { return p_y * 180.0 / Math_PI; } - static _ALWAYS_INLINE_ float rad2deg(float p_y) { return p_y * 180.0 / Math_PI; } + static _ALWAYS_INLINE_ double rad2deg(double p_y) { return p_y * (180.0 / Math_PI); } + static _ALWAYS_INLINE_ float rad2deg(float p_y) { return p_y * (180.0 / Math_PI); } static _ALWAYS_INLINE_ double lerp(double p_from, double p_to, double p_weight) { return p_from + (p_to - p_from) * p_weight; } static _ALWAYS_INLINE_ float lerp(float p_from, float p_to, float p_weight) { return p_from + (p_to - p_from) * p_weight; } |
