diff options
| author | Juan Linietsky <reduzio@gmail.com> | 2020-11-06 14:24:38 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-06 14:24:38 -0300 |
| commit | 207f8c08b3f161ea0e84c3f51d4c86662633b5c9 (patch) | |
| tree | 1eb1930e9124c5ecf77840e80ebed64cbb85608c /core/math/vector2.cpp | |
| parent | 391d29f558d122798416b5957660d9eeceecd0f5 (diff) | |
| parent | f2397809a84c2bf0d41e6cb2092fa8f3c5a17850 (diff) | |
| download | redot-engine-207f8c08b3f161ea0e84c3f51d4c86662633b5c9.tar.gz | |
Merge pull request #43323 from reduz/variant-bind-rework2
Refactored Variant Operators.
Diffstat (limited to 'core/math/vector2.cpp')
| -rw-r--r-- | core/math/vector2.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/math/vector2.cpp b/core/math/vector2.cpp index 233421e070..75e742a5f1 100644 --- a/core/math/vector2.cpp +++ b/core/math/vector2.cpp @@ -233,6 +233,19 @@ void Vector2i::operator/=(const int &rvalue) { y /= rvalue; } +Vector2i Vector2i::operator%(const Vector2i &p_v1) const { + return Vector2i(x % p_v1.x, y % p_v1.y); +} + +Vector2i Vector2i::operator%(const int &rvalue) const { + return Vector2i(x % rvalue, y % rvalue); +} + +void Vector2i::operator%=(const int &rvalue) { + x %= rvalue; + y %= rvalue; +} + Vector2i Vector2i::operator-() const { return Vector2i(-x, -y); } |
