From 1701aa5a616f3de55b0a426f8d9e679f2c98a0c6 Mon Sep 17 00:00:00 2001 From: tylermurphy534 Date: Mon, 3 Oct 2022 06:50:49 -0400 Subject: mouse picking --- src/world.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/world.hpp') diff --git a/src/world.hpp b/src/world.hpp index 12e0285..e8882b2 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -1,9 +1,14 @@ #pragma once #include "xe_game_object.hpp" -#include "chunk_renderer.hpp" +#include "skinned_renderer.hpp" #include "chunk.hpp" +#define GLM_FORCE_RADIANS +#include +#include +#include + #include namespace app { @@ -12,6 +17,11 @@ class World { public: + struct Ray { + glm::ivec3 pos; + int hit; + }; + World(xe::GameObject& viewer, int renderDistance, int worldSeed); ~World(); @@ -20,6 +30,8 @@ class World { void render(xe::Camera& camera); + Ray raycast(float distance, int steps); + private: void resetChunks(); @@ -36,7 +48,7 @@ class World { const xe::GameObject& viewer; std::vector loadedChunks; - ChunkRenderer chunkRenderer; + SkinnedRenderer skinnedRenderer; }; -- cgit v1.2.3-freya