diff options
author | worktycho <work.tycho@gmail.com> | 2015-05-05 23:08:49 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2015-05-05 23:08:49 +0200 |
commit | 18a268a961d1a9d93fda2e4c0b18f9296f7dd768 (patch) | |
tree | 015da1c0d4fe80dc83653854d3a59a8f6a598832 /src/Vector3.h | |
parent | Merge pull request #1917 from Woazboat/CodeCleanup (diff) | |
parent | Revert "Small code cleanup" (diff) | |
download | cuberite-18a268a961d1a9d93fda2e4c0b18f9296f7dd768.tar cuberite-18a268a961d1a9d93fda2e4c0b18f9296f7dd768.tar.gz cuberite-18a268a961d1a9d93fda2e4c0b18f9296f7dd768.tar.bz2 cuberite-18a268a961d1a9d93fda2e4c0b18f9296f7dd768.tar.lz cuberite-18a268a961d1a9d93fda2e4c0b18f9296f7dd768.tar.xz cuberite-18a268a961d1a9d93fda2e4c0b18f9296f7dd768.tar.zst cuberite-18a268a961d1a9d93fda2e4c0b18f9296f7dd768.zip |
Diffstat (limited to 'src/Vector3.h')
-rw-r--r-- | src/Vector3.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Vector3.h b/src/Vector3.h index 071997f50..c5431438e 100644 --- a/src/Vector3.h +++ b/src/Vector3.h @@ -78,11 +78,6 @@ public: ); } - inline bool HasNonZeroLength(void) const - { - return ((x != 0) || (y != 0) || (z != 0)); - } - inline double Length(void) const { return sqrt(static_cast<double>(x * x + y * y + z * z)); @@ -126,7 +121,11 @@ public: { // Perform a bitwise comparison of the contents - we want to know whether this object is exactly equal // To perform EPS-based comparison, use the EqualsEps() function - return !((x != a_Rhs.x) || (y != a_Rhs.y) || (z != a_Rhs.z)); + return ( + (memcmp(&x, &a_Rhs.x, sizeof(x)) == 0) && + (memcmp(&y, &a_Rhs.y, sizeof(y)) == 0) && + (memcmp(&z, &a_Rhs.z, sizeof(z)) == 0) + ); } inline bool EqualsEps(const Vector3<T> & a_Rhs, T a_Eps) const |