diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-06-02 14:29:52 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-06-06 13:21:21 +0200 |
commit | 171c59a01b07b7513cf7a281bbcb141e8182d274 (patch) | |
tree | 6fd4b835b68b2dcde80a3f868d0b83f2987d2a54 /src/Vector3.h | |
parent | Improved link power behaviour (diff) | |
download | cuberite-171c59a01b07b7513cf7a281bbcb141e8182d274.tar cuberite-171c59a01b07b7513cf7a281bbcb141e8182d274.tar.gz cuberite-171c59a01b07b7513cf7a281bbcb141e8182d274.tar.bz2 cuberite-171c59a01b07b7513cf7a281bbcb141e8182d274.tar.lz cuberite-171c59a01b07b7513cf7a281bbcb141e8182d274.tar.xz cuberite-171c59a01b07b7513cf7a281bbcb141e8182d274.tar.zst cuberite-171c59a01b07b7513cf7a281bbcb141e8182d274.zip |
Diffstat (limited to 'src/Vector3.h')
-rw-r--r-- | src/Vector3.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Vector3.h b/src/Vector3.h index 346bc1bbb..279fe5cd7 100644 --- a/src/Vector3.h +++ b/src/Vector3.h @@ -235,6 +235,12 @@ public: return *this; } + /** Provides a hash of a vector's contents */ + size_t operator()(const Vector3<T> & a_Vector) const + { + return ((std::hash<T>()(a_Vector.x) ^ (std::hash<T>()(a_Vector.y) << 1)) ^ std::hash<T>()(a_Vector.z)); + } + // tolua_begin inline Vector3<T> operator + (const Vector3<T>& a_Rhs) const |