From 0ec7f3348ee339aebf6dcfb9aab9bf28e19eb067 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Thu, 16 Nov 2023 19:55:31 +0300 Subject: [PATCH] Typo fix --- src/frontend/world_render.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/frontend/world_render.cpp b/src/frontend/world_render.cpp index d7d4d3371..3e0536226 100644 --- a/src/frontend/world_render.cpp +++ b/src/frontend/world_render.cpp @@ -23,6 +23,7 @@ #include "../objects/player_control.h" #include "../maths/FrustumCulling.h" +using glm::vec3; using std::shared_ptr; WorldRenderer::WorldRenderer(Level* level, Assets* assets) : assets(assets), level(level) { @@ -52,8 +53,8 @@ bool WorldRenderer::drawChunk(size_t index, Camera* camera, Shader* shader, bool // Simple frustum culling if (occlusion){ - glm::vec3 min(chunk->x * CHUNK_W, chunk->bottom, chunk->z * CHUNK_D); - glm::vec3 max(chunk->x * CHUNK_W + CHUNK_W, chunk->top, chunk->z * CHUNK_D + CHUNK_D); + vec3 min(chunk->x * CHUNK_W, chunk->bottom, chunk->z * CHUNK_D); + vec3 max(chunk->x * CHUNK_W + CHUNK_W, chunk->top, chunk->z * CHUNK_D + CHUNK_D); if (!frustumCulling->IsBoxVisible(min, max)) return false; } @@ -145,7 +146,7 @@ void WorldRenderer::draw(Camera* camera, bool occlusion, float fogFactor, float float lenght = 40.f; linesShader->use(); - glm::mat4 model(glm::translate(glm::mat4(1.f), glm::vec3(Window::width >> 1, -static_cast(Window::height) >> 1, 0.f))); + glm::mat4 model(glm::translate(glm::mat4(1.f), vec3(Window::width >> 1, -static_cast(Window::height) >> 1, 0.f))); linesShader->uniformMatrix("u_projview", glm::ortho(0.f, static_cast(Window::width), -static_cast(Window::height), 0.f, -lenght, lenght) * model * glm::inverse(camera->rotation)); glDisable(GL_DEPTH_TEST);