From 831e814ce9bdb84e86c06c4a52008f6bdaaa00d6 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 16 Nov 2018 00:24:51 +0800 Subject: =?UTF-8?q?*=E5=90=88=E5=B9=B6master=E5=88=B0minimal=E5=88=86?= =?UTF-8?q?=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/Math/je_vector2.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (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 a2b3371..e9599e1 100644 --- a/src/libjin/Math/je_vector2.hpp +++ b/src/libjin/Math/je_vector2.hpp @@ -1,5 +1,5 @@ -#ifndef __JE_VECTOR_H -#define __JE_VECTOR_H +#ifndef __JE_VECTOR_H__ +#define __JE_VECTOR_H__ namespace JinEngine { @@ -25,6 +25,18 @@ namespace JinEngine data[1] = v.data[1]; } + void operator = (const Vector2& v) + { + data[0] = v.data[0]; + data[1] = v.data[1]; + } + + void set(T _x, T _y) + { + data[0] = _x; + data[1] = _y; + } + T &x = data[0], &y = data[1]; // xy T &w = data[0], &h = data[1]; // wh T &colum = data[0], &row = data[1]; // colum row -- cgit v1.1-26-g67d0