diff options
| author | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-01-28 21:51:39 +0100 |
|---|---|---|
| committer | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-01-29 09:59:18 +0100 |
| commit | 15369fdb1d692e1515dd888dfbae275074be63be (patch) | |
| tree | 46c06709329d06989d343b47cb3f2e5dae1400eb /core/math | |
| parent | 17e7f85c06366b427e5068c5b3e2940e27ff5f1d (diff) | |
| download | redot-engine-15369fdb1d692e1515dd888dfbae275074be63be.tar.gz | |
Remove unnecessary `this->` expressions
Diffstat (limited to 'core/math')
| -rw-r--r-- | core/math/convex_hull.cpp | 16 | ||||
| -rw-r--r-- | core/math/vector2.cpp | 4 | ||||
| -rw-r--r-- | core/math/vector3.cpp | 2 | ||||
| -rw-r--r-- | core/math/vector3.h | 4 |
4 files changed, 13 insertions, 13 deletions
diff --git a/core/math/convex_hull.cpp b/core/math/convex_hull.cpp index 68d995fe67..478fde3a64 100644 --- a/core/math/convex_hull.cpp +++ b/core/math/convex_hull.cpp @@ -344,31 +344,31 @@ public: Rational128(int64_t p_value) { if (p_value > 0) { sign = 1; - this->numerator = p_value; + numerator = p_value; } else if (p_value < 0) { sign = -1; - this->numerator = -p_value; + numerator = -p_value; } else { sign = 0; - this->numerator = (uint64_t)0; + numerator = (uint64_t)0; } - this->denominator = (uint64_t)1; + denominator = (uint64_t)1; is_int_64 = true; } Rational128(const Int128 &p_numerator, const Int128 &p_denominator) { sign = p_numerator.get_sign(); if (sign >= 0) { - this->numerator = p_numerator; + numerator = p_numerator; } else { - this->numerator = -p_numerator; + numerator = -p_numerator; } int32_t dsign = p_denominator.get_sign(); if (dsign >= 0) { - this->denominator = p_denominator; + denominator = p_denominator; } else { sign = -sign; - this->denominator = -p_denominator; + denominator = -p_denominator; } is_int_64 = false; } diff --git a/core/math/vector2.cpp b/core/math/vector2.cpp index df8c804243..42191eccbf 100644 --- a/core/math/vector2.cpp +++ b/core/math/vector2.cpp @@ -164,7 +164,7 @@ Vector2 Vector2::slide(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 *this - p_normal * this->dot(p_normal); + return *this - p_normal * dot(p_normal); } Vector2 Vector2::bounce(const Vector2 &p_normal) const { @@ -175,7 +175,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.0f * p_normal * this->dot(p_normal) - *this; + return 2.0f * p_normal * dot(p_normal) - *this; } bool Vector2::is_equal_approx(const Vector2 &p_v) const { diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp index ae009fc4ef..c483d659a3 100644 --- a/core/math/vector3.cpp +++ b/core/math/vector3.cpp @@ -109,7 +109,7 @@ Vector3 Vector3::octahedron_decode(const Vector2 &p_oct) { Vector2 Vector3::octahedron_tangent_encode(const float sign) const { const float bias = 1.0f / 32767.0f; - Vector2 res = this->octahedron_encode(); + Vector2 res = octahedron_encode(); res.y = MAX(res.y, bias); res.y = res.y * 0.5f + 0.5f; res.y = sign >= 0.0f ? res.y : 1 - res.y; diff --git a/core/math/vector3.h b/core/math/vector3.h index 18943a820f..bdf49a019e 100644 --- a/core/math/vector3.h +++ b/core/math/vector3.h @@ -514,7 +514,7 @@ Vector3 Vector3::slide(const Vector3 &p_normal) const { #ifdef MATH_CHECKS ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector3(), "The normal Vector3 must be normalized."); #endif - return *this - p_normal * this->dot(p_normal); + return *this - p_normal * dot(p_normal); } Vector3 Vector3::bounce(const Vector3 &p_normal) const { @@ -525,7 +525,7 @@ Vector3 Vector3::reflect(const Vector3 &p_normal) const { #ifdef MATH_CHECKS ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector3(), "The normal Vector3 must be normalized."); #endif - return 2.0f * p_normal * this->dot(p_normal) - *this; + return 2.0f * p_normal * dot(p_normal) - *this; } #endif // VECTOR3_H |
