diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-02-12 10:01:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-12 10:01:48 +0100 |
commit | daf9729b925ea13d77312bb3ce18198e158c03a8 (patch) | |
tree | 44dba39a46237db559a8ab82189328f171492edd /core/math/vector2.cpp | |
parent | 7a7fabe4f6d66ffb0c0fbbaf1696e67456c383d7 (diff) | |
parent | 5298e16e80e032a7ff0c6a661b826859e5aeccd0 (diff) |
Merge pull request #57703 from lawnjelly/float_literals_math_funcs
Diffstat (limited to 'core/math/vector2.cpp')
-rw-r--r-- | core/math/vector2.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/math/vector2.cpp b/core/math/vector2.cpp index 40149e8cc1..120b66e432 100644 --- a/core/math/vector2.cpp +++ b/core/math/vector2.cpp @@ -163,11 +163,11 @@ Vector2 Vector2::cubic_interpolate(const Vector2 &p_b, const Vector2 &p_pre_a, c real_t t3 = t2 * t; Vector2 out; - out = 0.5 * - ((p1 * 2.0) + + out = 0.5f * + ((p1 * 2.0f) + (-p0 + p2) * t + - (2.0 * p0 - 5.0 * p1 + 4 * p2 - p3) * t2 + - (-p0 + 3.0 * p1 - 3.0 * p2 + p3) * t3); + (2.0f * p0 - 5.0f * p1 + 4 * p2 - p3) * t2 + + (-p0 + 3.0f * p1 - 3.0f * p2 + p3) * t3); return out; } @@ -194,7 +194,7 @@ Vector2 Vector2::reflect(const Vector2 &p_normal) const { #ifdef MATH_CHECKS ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector2(), "The normal Vector2 must be normalized."); #endif - return 2.0 * p_normal * this->dot(p_normal) - *this; + return 2.0f * p_normal * this->dot(p_normal) - *this; } bool Vector2::is_equal_approx(const Vector2 &p_v) const { |