00001 #ifndef Vector3_H 00002 #define Vector3_H 00003 00004 #include <QString> 00005 #include <QDebug> 00006 00007 #define PI 3.14159265 00008 00009 class Vector3 00010 { 00011 public: 00012 Vector3(); 00013 Vector3(float x, float y, float z); 00014 00015 Vector3& operator=(const Vector3 &vec); 00016 00017 const Vector3 operator+(const Vector3 &vec) const; 00018 const Vector3 operator-(const Vector3 &vec) const; 00019 const Vector3 operator-(float val) const; 00020 const Vector3 operator*(float val) const; 00021 const float operator*(const Vector3 &vec) const; 00022 const Vector3 operator/(float val) const; 00023 Vector3& operator*=(float val); 00024 Vector3& operator/=(float val); 00025 00026 float length() const; 00027 float getAngle(const Vector3 &vec) const; 00028 void normalize(); 00029 00030 public: 00031 float x, y, z; 00032 }; 00033 00034 QDebug operator<<(QDebug dbg, const Vector3 &vec); 00035 00036 #endif // Vector3_H