1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-05 11:57:58 +00:00

small_hyperboloid more universal

This commit is contained in:
Zeno Rogue
2024-06-28 14:00:52 +02:00
parent 90b416f594
commit be949b3698
3 changed files with 27 additions and 6 deletions

View File

@@ -925,6 +925,7 @@ EX void apply_other_model(shiftpoint H_orig, hyperpoint& ret, eModel md) {
switch(cgclass) {
case gcHyperbolic: {
if(pconf.small_hyperboloid) H = mid(C0, H);
ld zl = zlevel(H);
ret = H / H[2];
ret[2] = sqrt(1 - sqhypot_d(2, ret));
@@ -944,11 +945,13 @@ EX void apply_other_model(shiftpoint H_orig, hyperpoint& ret, eModel md) {
ret[2] = (1 - y);
ret[2] *= dir;
ret = ret * (1 + (H[2]-1) * y * pconf.depth_scaling * dir / pconf.euclid_to_sphere);
if(pconf.small_hyperboloid) { ret = ret - C0; ret = ret / hypot_d(3, ret); }
}
break;
}
case gcSphere: {
if(pconf.small_hyperboloid) H = mid(C0, H);
if(vrhr::rendering()) { vr_sphere(ret, H, md); return; }
ld z = sqhypot_d(3, H);
int s = H[2] > 0 ? 1 : -1;