From e7b90fdb05d94a21d139adbe64822db4f51d5eef Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 17 Nov 2018 19:25:15 +0100 Subject: [PATCH] fixed some minor issues with HyperRogue's 3D --- hyperpoint.cpp | 2 +- polygons.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hyperpoint.cpp b/hyperpoint.cpp index b297f78d..d2ed0449 100644 --- a/hyperpoint.cpp +++ b/hyperpoint.cpp @@ -176,7 +176,7 @@ ld sqhypot3(const hyperpoint& h) { ld zlevel(const hyperpoint &h) { if(euclid) return h[2]; else if(sphere) return sqrt(intval(h, Hypc)); - else return sqrt(-intval(h, Hypc)); + else return (h[2] < 0 ? -1 : 1) * sqrt(-intval(h, Hypc)); } // display a hyperbolic point diff --git a/polygons.cpp b/polygons.cpp index 1d054267..146c8655 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -171,7 +171,7 @@ void add1(const hyperpoint& H) { int spherespecial, spherephase; bool is_behind(const hyperpoint& H) { - return pmodel == mdDisk && vid.alpha + H[2] <= BEHIND_LIMIT; + return pmodel == mdDisk && (hyperbolic ? H[2] >= 0 : true) && vid.alpha + H[2] <= BEHIND_LIMIT; } hyperpoint be_just_on_view(const hyperpoint& H1, const hyperpoint &H2) {