From 1d574e5e8fe3f08d13f1b8c4444fc4cb02cf0faf Mon Sep 17 00:00:00 2001 From: Mel Date: Thu, 3 Aug 2023 02:29:44 +0200 Subject: World can now reassess chunk generation priorities on player movement and cancel no longer needed jobs --- src/World/Position.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/World/Position.hpp') diff --git a/src/World/Position.hpp b/src/World/Position.hpp index b603ee4..07de6f3 100644 --- a/src/World/Position.hpp +++ b/src/World/Position.hpp @@ -1,19 +1,23 @@ #pragma once #include "array" +#include "ChunkDimensions.hpp" #include "../Math/Vector.hpp" -namespace MC::World::Position { +namespace MC::Position { // Position within entire world. using World = Vector<3>; +// Offset between two world positions. +using WorldOffset = Vector<3>; + // Offset between block positions within single chunk. class BlockOffset : public Vector<3, I16> { public: BlockOffset(I16 x, I16 y, I16 z) : Vector(x, y, z) {} Bool fits_within_chunk() const { - using namespace ChunkDimensions; + using namespace MC::World::ChunkDimensions; return x() >= 0 && x() < Width && y() >= 0 && y() < Height && z() >= 0 && z() < Width; } }; -- cgit 1.4.1