diff options
-rw-r--r-- | src/Render.cpp | 4 | ||||
-rw-r--r-- | src/RendererSection.cpp | 6 | ||||
-rw-r--r-- | src/World.cpp | 1 |
3 files changed, 5 insertions, 6 deletions
diff --git a/src/Render.cpp b/src/Render.cpp index c905bd9..5c00d91 100644 --- a/src/Render.cpp +++ b/src/Render.cpp @@ -245,7 +245,7 @@ void Render::HandleEvents() { } case SDL_MOUSEBUTTONDOWN: { - if (!ImGui::GetIO().WantCaptureMouse) { + if (isMouseCaptured && !ImGui::GetIO().WantCaptureMouse) { if (event.button.button == SDL_BUTTON_LEFT) PUSH_EVENT("LmbPressed", 0); else if (event.button.button == SDL_BUTTON_RIGHT) @@ -256,7 +256,7 @@ void Render::HandleEvents() { } case SDL_MOUSEBUTTONUP: { - if (!ImGui::GetIO().WantCaptureMouse) { + if (isMouseCaptured && !ImGui::GetIO().WantCaptureMouse) { if (event.button.button == SDL_BUTTON_LEFT) PUSH_EVENT("LmbReleased", 0); else if (event.button.button == SDL_BUTTON_RIGHT) diff --git a/src/RendererSection.cpp b/src/RendererSection.cpp index 23b0a42..0311171 100644 --- a/src/RendererSection.cpp +++ b/src/RendererSection.cpp @@ -162,12 +162,10 @@ void RendererSection::Render(RenderState &renderState) { glCheckError(); } -Vector RendererSection::GetPosition() -{ +Vector RendererSection::GetPosition() { return sectionPos; } -size_t RendererSection::GetHash() -{ +size_t RendererSection::GetHash() { return hash; }
\ No newline at end of file diff --git a/src/World.cpp b/src/World.cpp index 110b16b..59399f5 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -138,6 +138,7 @@ const Section &World::GetSection(Vector sectionPos) { } } +// TODO: skip liquid blocks RaycastResult World::Raycast(glm::vec3 position, glm::vec3 direction) { const float maxLen = 5.0; const float step = 0.01; |