From bc3b4841b7b8f7aa34dafa927fdd1c9c43bfadda Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 3 Feb 2023 02:53:55 +0100 Subject: [PATCH] makeradar fixes --- radar.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/radar.cpp b/radar.cpp index d7f63bc4..0cbae099 100644 --- a/radar.cpp +++ b/radar.cpp @@ -3,13 +3,11 @@ namespace hr { #if MAXMDIM >= 4 pair makeradar(shiftpoint h) { - if(embedded_plane) h.h = current_display->radar_transform * h.h; - - ld d = hdist0(h); hyperpoint h1; - - if(sol && nisot::geodesic_movement && !embedded_plane) { + + if(embedded_plane) h1 = current_display->radar_transform * unshift(h); + else if(sol && nisot::geodesic_movement) { hyperpoint h1 = inverse_exp(h, pQUICK); ld r = hypot_d(3, h1); if(r < 1) h1 = h1 * (atanh(r) / r); @@ -18,17 +16,18 @@ pair makeradar(shiftpoint h) { else if(mproduct) h1 = product::inverse_exp(unshift(h)); else if(sl2) h1 = slr::get_inverse_exp(h); else h1 = unshift(h); - + if(nisot::local_perspective_used && !embedded_plane) { h1 = NLP * h1; } if(WDIM == 3) { + ld d = hdist0(h); if(d >= vid.radarrange) return {false, h1}; if(d) h1 = h1 * (d / vid.radarrange / hypot_d(3, h1)); } else { - h1 = cgi.emb->actual_to_base(h.h); + h1 = cgi.emb->actual_to_base(h1); h1 = current_display->radar_transform_post * h1; if(mhyperbolic) { h1[LDIM] = h1[2]; h1[2] = 0; @@ -36,7 +35,7 @@ pair makeradar(shiftpoint h) { h1[3] *= 2; } if(meuclid) { - d = hypot_d(2, h1); + ld d = hypot_d(2, h1); if(d > vid.radarrange) return {false, h1}; if(d) h1 = h1 / (vid.radarrange + cgi.scalefactor/4); }