通过float*生成vector
This commit is contained in:
@@ -51,6 +51,12 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline TVector2& operator = (const T* pScalar) {
|
||||
x = pScalar[0];
|
||||
y = pScalar[1];
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline bool operator == (const TVector2& rkVector) const {
|
||||
return (x == rkVector.x && y == rkVector.y);
|
||||
}
|
||||
|
||||
@@ -62,6 +62,13 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline TVector3& operator = (const T* pScalar) {
|
||||
x = pScalar[0];
|
||||
y = pScalar[1];
|
||||
z = pScalar[2];
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline bool operator == (const TVector3& rkVector) const {
|
||||
return (x == rkVector.x && y == rkVector.y && z == rkVector.z);
|
||||
}
|
||||
|
||||
@@ -73,6 +73,14 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline TVector4& operator = (const T* pScalar) {
|
||||
x = pScalar[0];
|
||||
y = pScalar[1];
|
||||
z = pScalar[2];
|
||||
w = pScalar[4];
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline bool operator == (const TVector4& rkVector) const {
|
||||
return (x == rkVector.x && y == rkVector.y && z == rkVector.z && w == rkVector.w);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user