diff options
author | chai <chaifix@163.com> | 2019-03-29 22:51:04 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-03-29 22:51:04 +0800 |
commit | c302f5ae5f9e30a28e487e8a764d9cc31546bbea (patch) | |
tree | 7f18bedeece950600336ea7ced7c52c468552c98 /source/libs/asura-lib-utils/math/vector2.inl | |
parent | 157530b8b6e11efc5573d5a0db8987a440197aa1 (diff) |
*rename
Diffstat (limited to 'source/libs/asura-lib-utils/math/vector2.inl')
-rw-r--r-- | source/libs/asura-lib-utils/math/vector2.inl | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/source/libs/asura-lib-utils/math/vector2.inl b/source/libs/asura-lib-utils/math/vector2.inl deleted file mode 100644 index 9e131a7..0000000 --- a/source/libs/asura-lib-utils/math/vector2.inl +++ /dev/null @@ -1,114 +0,0 @@ -template <typename T> -inline Vector2<T>::Vector2() : - x(0), - y(0) -{ - -} - -template <typename T> -inline Vector2<T>::Vector2(T X, T Y) : - x(X), - y(Y) -{ - -} - -template <typename T> -template <typename U> -inline Vector2<T>::Vector2(const Vector2<U>& vector) : - x(static_cast<T>(vector.x)), - y(static_cast<T>(vector.y)) -{ -} - -template <typename T> -inline Vector2<T>::Set(T X, T Y) -{ - x = X; - y = Y; -} - -template <typename T> -inline Vector2<T> operator -(const Vector2<T>& right) -{ - return Vector2<T>(-right.x, -right.y); -} - -template <typename T> -inline Vector2<T>& operator +=(Vector2<T>& left, const Vector2<T>& right) -{ - left.x += right.x; - left.y += right.y; - - return left; -} - -template <typename T> -inline Vector2<T>& operator -=(Vector2<T>& left, const Vector2<T>& right) -{ - left.x -= right.x; - left.y -= right.y; - - return left; -} - -template <typename T> -inline Vector2<T> operator +(const Vector2<T>& left, const Vector2<T>& right) -{ - return Vector2<T>(left.x + right.x, left.y + right.y); -} - -template <typename T> -inline Vector2<T> operator -(const Vector2<T>& left, const Vector2<T>& right) -{ - return Vector2<T>(left.x - right.x, left.y - right.y); -} - -template <typename T> -inline Vector2<T> operator *(const Vector2<T>& left, T right) -{ - return Vector2<T>(left.x * right, left.y * right); -} - -template <typename T> -inline Vector2<T> operator *(T left, const Vector2<T>& right) -{ - return Vector2<T>(right.x * left, right.y * left); -} - -template <typename T> -inline Vector2<T>& operator *=(Vector2<T>& left, T right) -{ - left.x *= right; - left.y *= right; - - return left; -} - -template <typename T> -inline Vector2<T> operator /(const Vector2<T>& left, T right) -{ - return Vector2<T>(left.x / right, left.y / right); -} - -template <typename T> -inline Vector2<T>& operator /=(Vector2<T>& left, T right) -{ - left.x /= right; - left.y /= right; - - return left; -} - -template <typename T> -inline bool operator ==(const Vector2<T>& left, const Vector2<T>& right) -{ - return (left.x == right.x) && (left.y == right.y); -} - -template <typename T> -inline bool operator !=(const Vector2<T>& left, const Vector2<T>& right) -{ - return (left.x != right.x) || (left.y != right.y); -} |