summaryrefslogtreecommitdiffstats
path: root/src/Vector3.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-06-02 14:29:52 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-06-06 13:21:21 +0200
commit171c59a01b07b7513cf7a281bbcb141e8182d274 (patch)
tree6fd4b835b68b2dcde80a3f868d0b83f2987d2a54 /src/Vector3.h
parentImproved link power behaviour (diff)
downloadcuberite-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 '')
-rw-r--r--src/Vector3.h6
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