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

non-isotropic hyperbolic space

This commit is contained in:
Zeno Rogue
2019-10-01 05:03:46 +02:00
parent 255186840f
commit d6ab96f821
16 changed files with 403 additions and 223 deletions

View File

@@ -967,7 +967,7 @@ EX bool invalid_point(const hyperpoint h) {
EX bool in_smart_range(const transmatrix& T) {
hyperpoint h = tC0(T);
if(invalid_point(h)) return false;
if(nil) return true;
if(nil || nih) return true;
#if CAP_SOLV
if(pmodel == mdGeodesic) return solv::in_table_range(h);
#endif
@@ -2011,6 +2011,13 @@ EX bool do_draw(cell *c, const transmatrix& T) {
if(!nisot::in_table_range(tC0(T))) return false;
if(!limited_generation(c)) return false;
}
else if(pmodel == mdGeodesic && nih) {
hyperpoint h = inverse_exp(tC0(T), iLazy, false);
ld dist = hypot_d(3, h);
if(isnan(dist)) binary::breakhere();
if(dist > sightranges[geometry] + (vid.sloppy_3d ? 0 : cgi.corner_bonus)) return false;
if(dist <= extra_generation_distance && !limited_generation(c)) return false;
}
else if(pmodel == mdGeodesic && sl2) {
if(hypot(tC0(T)[2], tC0(T)[3]) > cosh(slr::range_xy)) return false;
if(!limited_generation(c)) return false;