VoxelEngine
 
Loading...
Searching...
No Matches
hash.h
1#pragma once
2
3#include "level/ChunkID.h"
4#include "random/Random.h"
5
6#include <functional>
7
8namespace std {
9 template <>
10 struct hash<glm::ivec3> {
11 size_t operator()(const glm::ivec3& k) const {
12 return engine::Random::hash3D(k.x, k.y, k.z);
13 }
14 };
15
16 template <>
17 struct hash<engine::ChunkID> {
18 size_t operator()(const engine::ChunkID& k) const {
19 return engine::Random::hash3D(k.x, k.y, k.z);
20 }
21 };
22
23} // namespace std
Definition ChunkID.h:8