From 1d54138b94a384917d47abd8109c586b1b7ac323 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 25 Nov 2018 13:08:56 +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_quad.h | 7 +++---- src/libjin/math/je_vector2.hpp | 5 +++++ 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/libjin/math') diff --git a/src/libjin/math/je_quad.h b/src/libjin/math/je_quad.h index fd5e7a1..b07b5f6 100644 --- a/src/libjin/math/je_quad.h +++ b/src/libjin/math/je_quad.h @@ -15,17 +15,16 @@ namespace JinEngine : x(0), y(0), w(0), h(0) { } + Quad(float _x, float _y, float _w, float _h) : x(_x), y(_y), w(_w), h(_h) { } - /// - /// - /// + float x, y, w, h; }; } // namespace Math } // namespace JinEngine -#endif // __JE_QUAD_H__ +#endif // __JE_QUAD_H__ \ No newline at end of file diff --git a/src/libjin/math/je_vector2.hpp b/src/libjin/math/je_vector2.hpp index 0a1a1e8..406b756 100644 --- a/src/libjin/math/je_vector2.hpp +++ b/src/libjin/math/je_vector2.hpp @@ -42,6 +42,11 @@ namespace JinEngine data[1] += v.data[1]; } + Vector2 operator +(const Vector2& v) + { + return Vector2(data[0] + v.data[0], data[1] + v.data[1]); + } + void set(T _x, T _y) { data[0] = _x; -- cgit v1.1-26-g67d0