From a524cfdd2756ac945040ca9bed576fb2f68f8c9f Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sun, 16 May 2010 21:44:32 +0200 Subject: Imported project. --- vector.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 vector.h (limited to 'vector.h') diff --git a/vector.h b/vector.h new file mode 100644 index 0000000..3c590c3 --- /dev/null +++ b/vector.h @@ -0,0 +1,36 @@ +#ifndef _VECTOR_H_ +#define _VECTOR_H_ + +class Vector3 { + public: + union { + float x, r; + }; + union { + float y, g; + }; + union { + float z, b; + }; + + Vector3(); + Vector3(float p1, float p2, float p3); + Vector3(const Vector3& v); + + Vector3& operator=(const Vector3& v); +}; + +class Vector4 : public Vector3 { + public: + union { + float w, a; + }; + + Vector4(); + Vector4(float p1, float p2, float p3, float p4); + Vector4(const Vector4& v); + + Vector4& operator=(const Vector4& v); +}; + +#endif -- cgit v1.2.3