From fc7b4579e49aaeecc81919e247e03f68bd5abfd4 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 18 Nov 2018 22:32:55 +0800 Subject: =?UTF-8?q?*=E7=B2=92=E5=AD=90=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Math/je_vector2.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/libjin/Math/je_vector2.hpp') diff --git a/src/libjin/Math/je_vector2.hpp b/src/libjin/Math/je_vector2.hpp index e9599e1..b4cab44 100644 --- a/src/libjin/Math/je_vector2.hpp +++ b/src/libjin/Math/je_vector2.hpp @@ -31,6 +31,17 @@ namespace JinEngine data[1] = v.data[1]; } + Vector2 operator * (float n) + { + return Vector2(data[0]*n, data[1]*n); + } + + void operator +=(const Vector2 v) + { + data[0] += v.data[0]; + data[1] += v.data[1]; + } + void set(T _x, T _y) { data[0] = _x; -- cgit v1.1-26-g67d0