implemented TileMap, still need Shader for it with billboarding and all that jizz XD
This commit is contained in:
@@ -11,6 +11,9 @@ namespace TSE
|
||||
/// @brief the epsilon used as min float value for comparisons in the engine
|
||||
constexpr float TSE_EPSILON = 1e-6f;
|
||||
|
||||
/// @brief 32-bit golden ratio constant used for hash mixing
|
||||
constexpr uint TSE_HASH_GOLDEN_RATIO_32 = 0x9e3779b9u;
|
||||
|
||||
/// @brief a simple degrees to radiant conversion function
|
||||
/// @param deg the degrees value
|
||||
/// @return the radiant value
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "Types.hpp"
|
||||
#include "MathF.hpp"
|
||||
#include <functional>
|
||||
|
||||
namespace TSE
|
||||
{
|
||||
@@ -135,3 +137,17 @@ namespace TSE
|
||||
#pragma endregion methods
|
||||
};
|
||||
} // namespace TSE
|
||||
|
||||
namespace std
|
||||
{
|
||||
template<>
|
||||
struct hash<TSE::Vector2>
|
||||
{
|
||||
size_t operator()(const TSE::Vector2& v) const noexcept
|
||||
{
|
||||
size_t h1 = std::hash<float>{}(v.x);
|
||||
size_t h2 = std::hash<float>{}(v.y);
|
||||
return h1 ^ (h2 + TSE::TSE_HASH_GOLDEN_RATIO_32 + (h1 << 6) + (h1 >> 2));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user