From 5ced7d70d8a1d7c8348db560cb587e7fd5ecd51f Mon Sep 17 00:00:00 2001 From: Pedro Gimeno Date: Fri, 21 Feb 2020 01:01:13 +0100 Subject: [PATCH] Use Z for up (Part 4) Fix chunk visibility test and visibility of world at start. The assumptions about the working of screen coordinates in the previous commit were clearly wrong. --- client/source/world/ClientWorld.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/client/source/world/ClientWorld.cpp b/client/source/world/ClientWorld.cpp index b3fac593..2698d19a 100644 --- a/client/source/world/ClientWorld.cpp +++ b/client/source/world/ClientWorld.cpp @@ -226,10 +226,7 @@ void ClientWorld::draw(gk::RenderTarget &target, gk::RenderStates states) const center.y /= center.w; // If it is behind the camera, don't bother drawing it - // Our screen coordinates are X right, Y up, and for a right-handed - // coordinate system, depth must be negative Z, so anything with a - // positive Z is behind the camera. - if(center.z > CHUNK_HEIGHT / 2) { + if(center.z < -CHUNK_HEIGHT / 2) { continue; }