1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-17 23:17:39 +00:00

fixed ODS; non-isotropic ODS

This commit is contained in:
Zeno Rogue
2020-02-26 01:27:04 +01:00
parent 00e436f0e2
commit 5d9fdd83a8
2 changed files with 30 additions and 7 deletions

View File

@@ -1170,9 +1170,14 @@ EX namespace ods {
ld phi = atan2(y, x) - atan2(y0, x0) + M_PI;
// ld delta = euclid ? hypot(y0,z) : atan2_auto(z / sin(theta), t / cos_auto(vid.ipd/2));
ld p = z / sin(theta) / t * cos_auto(vid.ipd / 2);
ld delta = (p > 1) ? 13 : (p < -1) ? -13 : atanh(p);
ld delta;
if(euclid) delta = hypot(y0, z);
else if(sphere) delta = atan2_auto(z / sin(theta), t / cos_auto(vid.ipd/2));
else {
// ld delta = euclid ? hypot(y0,z) : atan2_auto(z / sin(theta), t / cos_auto(vid.ipd/2));
ld p = z / sin(theta) / t * cos_auto(vid.ipd / 2);
delta = (p > 1) ? 13 : (p < -1) ? -13 : atanh(p);
}
if(euclid || hyperbolic) phi -= M_PI;
if(hyperbolic) delta = -delta;
@@ -1221,7 +1226,14 @@ EX namespace ods {
for(int j=0; j<3; j++) {
hyperpoint o = p->V * glhr::gltopoint((*p->tab)[p->offset+i+j]);
if(!project(o, h[j], h[j+3], global_projection == -1))
if(nonisotropic || prod) {
o = lp_apply(inverse_exp(o, iTable, false));
o[3] = 1;
dynamicval<eGeometry> g(geometry, gEuclid);
if(!project(o, h[j], h[j+3], global_projection == -1))
goto next_i;
}
else if(!project(o, h[j], h[j+3], global_projection == -1))
goto next_i;
}