From 57bf396ed52510fee5a34e479ca1f671faba2773 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sun, 23 May 2010 18:28:50 +0200 Subject: Added Vector2. --- engine/vector.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'engine/vector.h') diff --git a/engine/vector.h b/engine/vector.h index 3c590c3..179674f 100644 --- a/engine/vector.h +++ b/engine/vector.h @@ -1,7 +1,7 @@ #ifndef _VECTOR_H_ #define _VECTOR_H_ -class Vector3 { +class Vector2 { public: union { float x, r; @@ -9,14 +9,24 @@ class Vector3 { union { float y, g; }; + + Vector2(); + Vector2(float p1, float p2); + Vector2(const Vector2& v); + + Vector2& operator=(const Vector2& v); +}; + +class Vector3 : public Vector2 { + public: union { float z, b; }; - + Vector3(); Vector3(float p1, float p2, float p3); Vector3(const Vector3& v); - + Vector3& operator=(const Vector3& v); }; -- cgit v1.2.3