diff options
| author | Mel <einebeere@gmail.com> | 2023-08-06 04:27:07 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2023-08-06 04:27:07 +0200 |
| commit | 5a1b126f1f6d55226c2b5068d0c17c428fd29ba8 (patch) | |
| tree | 3acc0240cd8dedd0764eeae6df04e134b04584c8 /src/World/ChunkIndex.hpp | |
| parent | e6f5f9e03f673db796f1babb308609ca2576db2f (diff) | |
| download | meowcraft-5a1b126f1f6d55226c2b5068d0c17c428fd29ba8.tar.zst meowcraft-5a1b126f1f6d55226c2b5068d0c17c428fd29ba8.zip | |
Create separate Player entity and add bad collision system
Diffstat (limited to 'src/World/ChunkIndex.hpp')
| -rw-r--r-- | src/World/ChunkIndex.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/World/ChunkIndex.hpp b/src/World/ChunkIndex.hpp index 70de99f..2e4fa67 100644 --- a/src/World/ChunkIndex.hpp +++ b/src/World/ChunkIndex.hpp @@ -22,8 +22,8 @@ struct ChunkIndex { } static ChunkIndex from_position(Position::BlockWorld pos) { - I32 chunk_x = std::round(pos.x() / ChunkDimensions::Width); - I32 chunk_y = std::round(pos.z() / ChunkDimensions::Width); + I32 chunk_x = std::floor((Real)pos.x() / ChunkDimensions::Width); + I32 chunk_y = std::floor((Real)pos.z() / ChunkDimensions::Width); return {chunk_x, chunk_y}; } |
