summaryrefslogtreecommitdiffstats
path: root/game/shared/types.hh
diff options
context:
space:
mode:
authoruntodesu <kirill@untode.su>2025-03-16 20:18:16 +0500
committeruntodesu <kirill@untode.su>2025-03-16 20:18:16 +0500
commita8fa9fe920d4ed48ed1b88a6e585cdbff648039e (patch)
tree63520fe106ff2e445fa93d2992d14d4f7e60b8e5 /game/shared/types.hh
parent933ed978a21d5ffefc376d66f0dc9f5354292ca7 (diff)
downloadvoxelius-a8fa9fe920d4ed48ed1b88a6e585cdbff648039e.tar.bz2
voxelius-a8fa9fe920d4ed48ed1b88a6e585cdbff648039e.zip
Improved terrain generation - features! [1/2]
- @reglnk asked me to commit this early to experiment with this weird-ass heightmap bug that messes with tree placement
Diffstat (limited to 'game/shared/types.hh')
-rw-r--r--game/shared/types.hh10
1 files changed, 5 insertions, 5 deletions
diff --git a/game/shared/types.hh b/game/shared/types.hh
index dace85e..a107e54 100644
--- a/game/shared/types.hh
+++ b/game/shared/types.hh
@@ -14,9 +14,9 @@ using chunk_pos = glm::vec<3, std::int32_t>;
using local_pos = glm::vec<3, std::int16_t>;
using voxel_pos = glm::vec<3, std::int64_t>;
-// A special 2D chunk coordinate used by world generation code
-// to cache things like 2D noise and terrain heightmap for performance reasons
-using worldgen_chunk_pos = glm::vec<2, chunk_pos::value_type>;
+using chunk_pos_xz = glm::vec<2, chunk_pos::value_type>;
+using local_pos_xz = glm::vec<2, local_pos::value_type>;
+using voxel_pos_xz = glm::vec<2, local_pos::value_type>;
template<>
struct std::hash<chunk_pos> final {
@@ -31,8 +31,8 @@ struct std::hash<chunk_pos> final {
};
template<>
-struct std::hash<worldgen_chunk_pos> final {
- constexpr inline std::size_t operator()(const worldgen_chunk_pos &cwpos) const
+struct std::hash<chunk_pos_xz> final {
+ constexpr inline std::size_t operator()(const chunk_pos_xz &cwpos) const
{
std::size_t value = 0;
value ^= cwpos.x * 73856093;