Skip to content

Commit

Permalink
Typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailRis committed Nov 16, 2023
1 parent 6cd775c commit 0ec7f33
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/frontend/world_render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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<int>(Window::height) >> 1, 0.f)));
glm::mat4 model(glm::translate(glm::mat4(1.f), vec3(Window::width >> 1, -static_cast<int>(Window::height) >> 1, 0.f)));
linesShader->uniformMatrix("u_projview", glm::ortho(0.f, static_cast<float>(Window::width), -static_cast<float>(Window::height), 0.f, -lenght, lenght) * model * glm::inverse(camera->rotation));

glDisable(GL_DEPTH_TEST);
Expand Down

0 comments on commit 0ec7f33

Please sign in to comment.