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.
This commit is contained in:
Pedro Gimeno 2020-02-21 01:01:13 +01:00
parent 9a1b193be9
commit 5ced7d70d8

View File

@ -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;
}