diff options
author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-02 19:34:48 -0500 |
---|---|---|
committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-02 19:34:48 -0500 |
commit | 93b3e4004387047c25b2f5a190aced01c9091934 (patch) | |
tree | 4bc8ff58dd7198bb2bfed77122547c9599b0ef0f /src/vector.h | |
parent | 9f0e76a47da72573863b22bda72d55e6010def6b (diff) | |
download | tanetane-93b3e4004387047c25b2f5a190aced01c9091934.tar.gz tanetane-93b3e4004387047c25b2f5a190aced01c9091934.tar.bz2 tanetane-93b3e4004387047c25b2f5a190aced01c9091934.zip |
Added collision with map tiles
Diffstat (limited to 'src/vector.h')
-rw-r--r-- | src/vector.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vector.h b/src/vector.h index 8019edf..9f6d54f 100644 --- a/src/vector.h +++ b/src/vector.h | |||
@@ -97,12 +97,16 @@ public: | |||
97 | return vec2(x() * other.x(), y() * other.y()); | 97 | return vec2(x() * other.x(), y() * other.y()); |
98 | } | 98 | } |
99 | 99 | ||
100 | vec2 operator/(const vec2& other) const { | ||
101 | return vec2(x() / other.x(), y() / other.y()); | ||
102 | } | ||
103 | |||
100 | bool operator==(const vec2& other) const { | 104 | bool operator==(const vec2& other) const { |
101 | return std::tie(x(), other.x()) == std::tie(y(), other.y()); | 105 | return (x() == other.x()) && (y() == other.y()); |
102 | } | 106 | } |
103 | 107 | ||
104 | bool operator!=(const vec2& other) const { | 108 | bool operator!=(const vec2& other) const { |
105 | return std::tie(x(), other.x()) != std::tie(y(), other.y()); | 109 | return (x() != other.x()) || (y() != other.y()); |
106 | } | 110 | } |
107 | 111 | ||
108 | }; | 112 | }; |