重新定义2维向量的大小比较操作符,暂时去掉3维和4纬向量的比较操作符
This commit is contained in:
@@ -59,6 +59,18 @@ public:
|
||||
return (x != rkVector.x || y != rkVector.y);
|
||||
}
|
||||
|
||||
inline bool operator > (const TVector2& rkVector) const {
|
||||
if (y > rkVector.y) return true;
|
||||
else if (y < rkVector.y) return false;
|
||||
else return x > rkVector.x;
|
||||
}
|
||||
|
||||
inline bool operator < (const TVector2& rkVector) const {
|
||||
if (y < rkVector.y) return true;
|
||||
else if (y > rkVector.y) return false;
|
||||
else return x < rkVector.x;
|
||||
}
|
||||
|
||||
public:
|
||||
// Arithmetic operations
|
||||
inline TVector2 operator + (const TVector2& rkVector) const {
|
||||
@@ -172,14 +184,6 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline bool operator < (const TVector2& rhs) const {
|
||||
return (x < rhs.x && y < rhs.y);
|
||||
}
|
||||
|
||||
inline bool operator > (const TVector2& rhs) const {
|
||||
return (x > rhs.x && y > rhs.y);
|
||||
}
|
||||
|
||||
public:
|
||||
inline T length(void) const {
|
||||
return MathUtil::sqrt(x * x + y * y);
|
||||
|
||||
@@ -194,14 +194,6 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline bool operator < (const TVector3& rhs) const {
|
||||
return (x < rhs.x && y < rhs.y && z < rhs.z);
|
||||
}
|
||||
|
||||
inline bool operator > (const TVector3& rhs) const {
|
||||
return (x > rhs.x && y > rhs.y && z > rhs.z);
|
||||
}
|
||||
|
||||
public:
|
||||
inline T length(void) const {
|
||||
return MathUtil::sqrt(x * x + y * y + z * z);
|
||||
|
||||
@@ -210,14 +210,6 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline bool operator < (const TVector4& rhs) const {
|
||||
return (x < rhs.x && y < rhs.y && z < rhs.z && w < rhs.w);
|
||||
}
|
||||
|
||||
inline bool operator > (const TVector4& rhs) const {
|
||||
return (x > rhs.x && y > rhs.y && z > rhs.z && w > rhs.w);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
inline T dotProduct(const TVector4& vec) const {
|
||||
|
||||
Reference in New Issue
Block a user