diff options
author | Bernhard Liebl <Bernhard.Liebl@gmx.org> | 2017-12-25 15:58:14 +0100 |
---|---|---|
committer | Bernhard Liebl <Bernhard.Liebl@gmx.org> | 2017-12-25 15:58:14 +0100 |
commit | 517227943fbea90bfb528a2f04ce73ac17ba3e8b (patch) | |
tree | 92dc096dd009e7190cf390f90dc7fcd2c3fd79de /core/math/math_2d.cpp | |
parent | 32d8b99bc31e3762ae0dc017a05567da2802a313 (diff) | |
download | redot-engine-517227943fbea90bfb528a2f04ce73ac17ba3e8b.tar.gz |
Inline some very common Vector2 operations
Diffstat (limited to 'core/math/math_2d.cpp')
-rw-r--r-- | core/math/math_2d.cpp | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/core/math/math_2d.cpp b/core/math/math_2d.cpp index 11003c1cd5..8ad164d4dc 100644 --- a/core/math/math_2d.cpp +++ b/core/math/math_2d.cpp @@ -102,69 +102,6 @@ Vector2 Vector2::cross(real_t p_other) const { return Vector2(p_other * y, -p_other * x); } -Vector2 Vector2::operator+(const Vector2 &p_v) const { - - return Vector2(x + p_v.x, y + p_v.y); -} -void Vector2::operator+=(const Vector2 &p_v) { - - x += p_v.x; - y += p_v.y; -} -Vector2 Vector2::operator-(const Vector2 &p_v) const { - - return Vector2(x - p_v.x, y - p_v.y); -} -void Vector2::operator-=(const Vector2 &p_v) { - - x -= p_v.x; - y -= p_v.y; -} - -Vector2 Vector2::operator*(const Vector2 &p_v1) const { - - return Vector2(x * p_v1.x, y * p_v1.y); -}; - -Vector2 Vector2::operator*(const real_t &rvalue) const { - - return Vector2(x * rvalue, y * rvalue); -}; -void Vector2::operator*=(const real_t &rvalue) { - - x *= rvalue; - y *= rvalue; -}; - -Vector2 Vector2::operator/(const Vector2 &p_v1) const { - - return Vector2(x / p_v1.x, y / p_v1.y); -}; - -Vector2 Vector2::operator/(const real_t &rvalue) const { - - return Vector2(x / rvalue, y / rvalue); -}; - -void Vector2::operator/=(const real_t &rvalue) { - - x /= rvalue; - y /= rvalue; -}; - -Vector2 Vector2::operator-() const { - - return Vector2(-x, -y); -} - -bool Vector2::operator==(const Vector2 &p_vec2) const { - - return x == p_vec2.x && y == p_vec2.y; -} -bool Vector2::operator!=(const Vector2 &p_vec2) const { - - return x != p_vec2.x || y != p_vec2.y; -} Vector2 Vector2::floor() const { return Vector2(Math::floor(x), Math::floor(y)); |