1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-19 23:25:13 +00:00

2d3d:: better radar in sphere, also better sin/cos in general

This commit is contained in:
Zeno Rogue
2019-05-15 11:13:23 +02:00
parent 1769f65ddb
commit dec0d191a8
2 changed files with 23 additions and 5 deletions

View File

@@ -721,6 +721,12 @@ void addradar(const transmatrix& V, char ch, color_t col, color_t outline) {
h[0] = h[0] / (1 + h[3]);
h[2] = 0;
}
else if(sphere) {
ld z = h[2] + h[1]/1000000;
h[1] = hypot(h[2], h[1]);
if(z < 0) h[1] = -h[1];
h[2] = h[3];
}
else {
ld z = h[2] + h[1]/1000000;
if(d) h = h * (d / sightranges[geometry] / hypot_d(3, h));