Added skZero for other vector types

This commit is contained in:
Jack Andersen
2017-03-17 13:30:14 -10:00
parent f1e3db1c50
commit 8603353cf7
7 changed files with 11 additions and 36 deletions

View File

@@ -94,7 +94,7 @@ public:
{
v[0] = x;
v[1] = y;
v[2] = 0;
v[2] = 0.0f;
v[3] = 0.0f;
}
CVector2f(float x, float y) { assign(x, y); }
@@ -313,14 +313,7 @@ public:
inline void zeroOut()
{
#if __SSE__
mVec128 = _mm_xor_ps(mVec128, mVec128);
#else
v[0] = 0.0;
v[1] = 0.0;
v[2] = 0.0;
v[3] = 0.0;
#endif
*this = CVector2f::skZero;
}
inline void splat(float xy)

View File

@@ -58,7 +58,6 @@ public:
v[0] = x;
v[1] = y;
v[2] = z;
v[3] = 0.0;
#endif
}
@@ -140,15 +139,7 @@ public:
void zeroOut()
{
#if __SSE__
_mm_xor_pd(mVec128[0], mVec128[0]);
_mm_xor_pd(mVec128[1], mVec128[1]);
#else
v[0] = 0.0;
v[1] = 0.0;
v[2] = 0.0;
v[3] = 0.0;
#endif
*this = skZero;
}
inline CVector3d operator+(const CVector3d& rhs) const
@@ -203,6 +194,8 @@ public:
__m128d mVec128[2];
#endif
};
static const CVector3d skZero;
};
static inline CVector3d operator+(double lhs, const CVector3d& rhs)

View File

@@ -317,14 +317,7 @@ public:
inline void zeroOut()
{
#if __SSE__
mVec128 = _mm_xor_ps(mVec128, mVec128);
#else
v[0] = 0.0;
v[1] = 0.0;
v[2] = 0.0;
v[3] = 0.0;
#endif
*this = CVector3f::skZero;
}
inline void splat(float xyz)

View File

@@ -347,14 +347,7 @@ public:
inline void zeroOut()
{
#if __SSE__
mVec128 = _mm_xor_ps(mVec128, mVec128);
#else
v[0] = 0.0;
v[1] = 0.0;
v[2] = 0.0;
v[3] = 0.0;
#endif
*this = CVector4f::skZero;
}
inline void splat(float xyzw)