1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-29 04:47:41 +00:00

improved display in Halloween

This commit is contained in:
Zeno Rogue
2017-10-09 11:46:49 +02:00
parent 32edc68a6d
commit 0c154d6751
4 changed files with 64 additions and 3 deletions

View File

@@ -291,10 +291,34 @@ bool behindsphere(const hyperpoint& h) {
return false;
}
ld to01(ld a0, ld a1, ld x) {
if(x < a0) return 0;
if(x > a1) return 1;
return (x-a0) / (a1-a0);
}
ld spherity(const hyperpoint& h) {
if(!sphere) return 1;
if(vid.alpha > 1) {
return to01(1/vid.alpha, 1, -h[2]);
}
if(vid.alpha <= 1) {
return to01(-.8, 1, h[2]);
}
return 1;
}
bool behindsphere(const transmatrix& V) {
return behindsphere(tC0(V));
}
ld spherity(const transmatrix& V) {
return spherity(tC0(V));
}
bool confusingGeometry() {
return elliptic || quotient == 1 || torus;
}