00001
00002 #ifndef __VECTOR4_H__
00003 #define __VECTOR4_H__
00004
00005 #include "Vector3.h"
00006
00007 class Vector4
00008 {
00009 public:
00010
00011 Vector4();
00012
00013
00014 Vector4(const float x, const float y, const float z, const float w);
00015 Vector4(const Vector4& other);
00016
00017
00018 const Vector4& operator=(const Vector4& other);
00019
00020
00021 bool operator==(const Vector4& other) const;
00022 bool operator!=(const Vector4& other) const;
00023 bool operator<(const Vector4& other) const;
00024
00025
00026 const Vector4 operator-() const;
00027
00028
00029 const Vector4 operator+(const Vector4& other) const;
00030 const Vector4& operator+=(const Vector4& other);
00031
00032
00033 const Vector4 operator-(const Vector4& other) const;
00034 const Vector4& operator-=(const Vector4& other);
00035
00036
00037 const Vector4 operator*(const Vector4& other) const;
00038 const Vector4& operator*=(const Vector4& other);
00039
00040
00041 const Vector4 operator*(const float scalar) const;
00042 const Vector4& operator*=(const float scalar);
00043
00044
00045 const Vector4 operator/(const Vector4& other) const;
00046 const Vector4& operator/=(const Vector4& other);
00047
00048
00049 const Vector4 operator/(const float scalar) const;
00050 const Vector4& operator/=(const float scalar);
00051
00052
00053 float Length() const;
00054 float SquaredLength() const;
00055 float DotProduct(const Vector4& other) const;
00056 void Normalize();
00057
00058 Vector3 ToVector3(void) const;
00059
00060 public:
00061 static const Vector4 ZERO;
00062 static const Vector4 X_AXIS;
00063 static const Vector4 Y_AXIS;
00064 static const Vector4 Z_AXIS;
00065 static const Vector4 W_AXIS;
00066
00067 union
00068 {
00069 struct
00070 {
00071 float comp[4];
00072 };
00073
00074 struct
00075 {
00076 float x;
00077 float y;
00078 float z;
00079 float w;
00080 };
00081 };
00082 };
00083
00084 #endif //__VECTOR4_H__