From a8fa9fe920d4ed48ed1b88a6e585cdbff648039e Mon Sep 17 00:00:00 2001 From: untodesu Date: Sun, 16 Mar 2025 20:18:16 +0500 Subject: 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 --- game/shared/types.hh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'game/shared/types.hh') 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 final { @@ -31,8 +31,8 @@ struct std::hash final { }; template<> -struct std::hash final { - constexpr inline std::size_t operator()(const worldgen_chunk_pos &cwpos) const +struct std::hash final { + constexpr inline std::size_t operator()(const chunk_pos_xz &cwpos) const { std::size_t value = 0; value ^= cwpos.x * 73856093; -- cgit