move Chunks from Level to Player

This commit is contained in:
MihailRis
2024-12-17 19:40:00 +03:00
parent b7664b4188
commit 1c18c02092
40 changed files with 450 additions and 220 deletions
+10 -2
View File
@@ -9,6 +9,7 @@
#include "physics/Hitbox.hpp"
#include "voxels/Chunks.hpp"
#include "voxels/Block.hpp"
#include "voxels/blocks_agent.hpp"
#include "window/Camera.hpp"
using namespace scripting;
@@ -149,8 +150,15 @@ static int l_raycast(lua::State* L) {
blockid_t block = BLOCK_VOID;
if (auto voxel = level->chunks->rayCast(
start, dir, maxDistance, end, normal, iend, filteredBlocks
if (auto voxel = blocks_agent::raycast(
*level->chunksStorage,
start,
dir,
maxDistance,
end,
normal,
iend,
filteredBlocks
)) {
maxDistance = glm::distance(start, end);
block = voxel->id;