1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-26 18:10:35 +00:00

fixed radar in euc_in_sph (no animate), radar in euc_in_product (somewhat), fixed_YZ in euc_in_sph

This commit is contained in:
Zeno Rogue 2023-01-08 15:48:34 +01:00
parent 742355433a
commit 763a932aca
3 changed files with 26 additions and 1 deletions

View File

@ -5098,6 +5098,9 @@ EX void make_actual_view() {
current_display->radar_transform = R * zpush(z);
}
else if(geom3::euc_in_sph()) {
current_display->radar_transform = inverse(View);
}
else {
transmatrix T = actual_view_transform * View;
transmatrix U = view_inverse(T);

View File

@ -1910,7 +1910,7 @@ EX hyperpoint vertical_vector() {
}
if(embedded_plane && geom3::same_in_same())
return get_view_orientation() * lztangent(vid.wall_height);
if(geom3::euc_in_sl2()) {
if(geom3::euc_in_sl2() || geom3::euc_in_sph()) {
transmatrix Rot = View * map_relative_push(inverse(View) * C0);
return Rot * lztangent(vid.wall_height);
}

View File

@ -54,6 +54,28 @@ pair<bool, hyperpoint> makeradar(shiftpoint h) {
if(d > vid.radarrange) return {false, h1};
if(d) h1 = h1 * (d / (vid.radarrange + cgi.scalefactor/4) / hypot_d(3, h1));
}
else if(geom3::euc_in_sph()) {
h1[0] = atan2(h.h[0], h.h[2]);
h1[1] = atan2(h.h[1], h.h[3]);
h1[2] = 0;
h1 = cgi.intermediate_to_logical * h1;
d = hypot_d(2, h1);
if(d > vid.radarrange) return {false, h1};
if(d) h1 = h1 / (vid.radarrange + cgi.scalefactor/4);
}
else if(geom3::euc_in_product()) {
if(in_h2xe())
h1[0] = atanh(h.h[0] / h.h[2]);
else
h1[0] = atan2(h.h[2], h.h[0]);
h1[2] = - zlevel(h.h) - h.shift;
h1[1] = 0;
h1[3] = 0;
h1 = cgi.intermediate_to_logical * h1;
d = hypot_d(2, h1);
if(d > vid.radarrange) return {false, h1};
if(d) h1 = h1 / (vid.radarrange + cgi.scalefactor/4);
}
else {
d = hypot_d(2, h1);
if(d > vid.radarrange) return {false, h1};