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