mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-14 11:15:48 +00:00
makeradar fixes
This commit is contained in:
parent
5f3c638653
commit
bc3b4841b7
11
radar.cpp
11
radar.cpp
@ -3,13 +3,11 @@ namespace hr {
|
||||
|
||||
#if MAXMDIM >= 4
|
||||
pair<bool, hyperpoint> 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);
|
||||
@ -24,11 +22,12 @@ pair<bool, hyperpoint> makeradar(shiftpoint h) {
|
||||
}
|
||||
|
||||
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<bool, hyperpoint> 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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user