00001
00002 #ifndef __VECTOR3_H_
00003 #define __VECTOR3_H_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "Peonstdafx.h"
00027
00028 namespace peon
00029 {
00030
00037 class PEONMAIN_API Vector3
00038 {
00039 public:
00040
00042 float x;
00043
00045 float y;
00046
00048 float z;
00049
00050
00051 Vector3(float x_ = 0.0f, float y_ = 0.0f, float z_ = 0.0f);
00052 ~Vector3();
00053
00054 void set(float x_, float y_, float z_);
00055 float length(void);
00056 void normalize(void);
00057
00058
00059 static float distance(const Vector3 &v1, const Vector3 &v2);
00060 static float dotProduct(const Vector3 &v1, const Vector3 &v2 );
00061 static Vector3 crossProduct(const Vector3 &v1, const Vector3 &v2);
00062
00063
00064 Vector3 operator + (const Vector3 &other);
00065 Vector3 operator - (const Vector3 &other);
00066 Vector3 operator * (const Vector3 &other);
00067 Vector3 operator / (const Vector3 &other);
00068
00069 Vector3 operator * (const float scalar);
00070 friend Vector3 operator * (const float scalar, const Vector3 &other);
00071
00072 Vector3& operator = (const Vector3 &other);
00073 Vector3& operator += (const Vector3 &other);
00074 Vector3& operator -= (const Vector3 &other);
00075
00076 Vector3 operator + (void) const;
00077 Vector3 operator - (void) const;
00078 };
00079
00080
00081
00082 }
00083
00084 #endif
00085