Add GetHash to various math/core types

#1802
This commit is contained in:
Wojtek Figat
2023-10-25 18:35:59 +02:00
parent fa836c50a0
commit 966cd973c6
3 changed files with 18 additions and 0 deletions

View File

@@ -977,6 +977,12 @@ inline Vector3Base<T> operator/(typename TOtherFloat<T>::Type a, const Vector3Ba
return Vector3Base<T>(a) / b;
}
template<typename T>
inline uint32 GetHash(const Vector3Base<T>& key)
{
return (((*(uint32*)&key.X * 397) ^ *(uint32*)&key.Y) * 397) ^ *(uint32*)&key.Z;
}
namespace Math
{
template<typename T>