added further fixes, and upgrades
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "Types.hpp"
|
||||
#include <functional>
|
||||
#include <cstddef>
|
||||
#include "MathF.hpp"
|
||||
|
||||
namespace TSE
|
||||
{
|
||||
@@ -145,3 +148,22 @@ namespace TSE
|
||||
|
||||
};
|
||||
} // namespace TSE
|
||||
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<>
|
||||
struct hash<TSE::Vector3>
|
||||
{
|
||||
size_t operator()(const TSE::Vector3& v) const noexcept
|
||||
{
|
||||
size_t h1 = std::hash<float>{}(v.x);
|
||||
size_t h2 = std::hash<float>{}(v.y);
|
||||
size_t h3 = std::hash<float>{}(v.z);
|
||||
size_t hash = h1;
|
||||
hash ^= h2 + TSE::TSE_HASH_GOLDEN_RATIO_32 + (hash << 6) + (hash >> 2);
|
||||
hash ^= h3 + TSE::TSE_HASH_GOLDEN_RATIO_32 + (hash << 6) + (hash >> 2);
|
||||
return hash;
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user