summaryrefslogtreecommitdiff
path: root/common/vector.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/vector.h')
-rw-r--r--common/vector.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/common/vector.h b/common/vector.h
new file mode 100644
index 0000000..de613dc
--- /dev/null
+++ b/common/vector.h
@@ -0,0 +1,43 @@
+// Vector.h: interface for the Vector class.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef _VECTOR_H_
+#define _VECTOR_H_
+
+class Vector
+{
+public:
+ float X();
+ float Y();
+ float Z();
+ float Dot(Vector& vec);
+ float Angle(Vector& vec);
+ void Add(float point[3]);
+ void Add(float x, float y, float z);
+ Vector& operator+=(Vector& add);
+ Vector& operator*=(float scalar);
+ Vector& operator=(Vector& source);
+ Vector& operator=(float point[3]);
+ bool operator==(Vector& vec);
+
+ Vector& Cross(Vector& v1, Vector& v2);
+
+ void ToFloat(float point[3]);
+ void FromFloat(float point[3]);
+ void FromFloat(float x, float y, float z);
+ float Length();
+ void Normalize();
+ void Scale(float scale);
+
+ Vector(float x, float y, float z);
+ Vector(float point[3]);
+ Vector(float p1[3], float p2[3]);
+ Vector();
+ virtual ~Vector();
+
+protected:
+ float m_fPoint[3];
+};
+
+#endif // _VECTOR_H_