From 4a03d938451763dfb95b534f9002865e72ea7ec5 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 16 Mar 2019 17:45:16 -0400 Subject: Can click to place tiles in editor now --- src/vector.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/vector.h') diff --git a/src/vector.h b/src/vector.h index c207dc8..ed20936 100644 --- a/src/vector.h +++ b/src/vector.h @@ -112,11 +112,29 @@ public: return vec2(x() * other.x(), y() * other.y()); } + vec2& operator/=(T s) + { + x() /= s; + y() /= s; + + return *this; + } + + constexpr vec2 operator/(const vec2& other) const + { + return vec2(x() / other.x(), y() / other.y()); + } + constexpr bool operator==(const vec2& other) const { return (x() == other.x()) && (y() == other.y()); } + constexpr bool operator!=(const vec2& other) const + { + return !(*this == other); + } + }; using vec2s = vec2; -- cgit 1.4.1