niltorus improvements

This commit is contained in:
Zeno Rogue 2019-11-02 22:19:32 +01:00
parent 8ba303f0f4
commit d4b2e0f88b
2 changed files with 17 additions and 2 deletions

View File

@ -434,7 +434,7 @@ EX int celldist(cell *c) {
}
if(fulltorus && WDIM == 2)
return get_torus_dist(decodeId(c->master));
if(nil) return DISTANCE_UNKNOWN;
if(nil && !quotient) return DISTANCE_UNKNOWN;
if(euwrap && WDIM == 2)
return torusconfig::cyldist(decodeId(c->master), 0);
if(masterless)

View File

@ -778,7 +778,7 @@ EX namespace nilv {
EX int zgmod(int a, int b) { return b ? gmod(a, b) : a; }
array<int,3> nilperiod, nilperiod_edit;
EX array<int,3> nilperiod, nilperiod_edit;
struct hrmap_nil : hrmap {
unordered_map<mvec, heptagon*> at;
@ -854,6 +854,13 @@ EX namespace nilv {
}
};
void set_flags() {
int coords = 0;
for(int a=0; a<3; a++) if(nilperiod[a]) coords++;
set_flag(ginf[gNil].flags, qANYQ, coords);
set_flag(ginf[gNil].flags, qBOUNDED, coords == 3);
}
EX hyperpoint on_geodesic(hyperpoint s0, hyperpoint s1, ld x) {
hyperpoint local = inverse(nisot::translate(s0)) * s1;
hyperpoint h = get_inverse_exp(local, 100);
@ -907,6 +914,7 @@ EX void show_niltorus3() {
dialog::add_action([] {
stop_game();
nilperiod = nilperiod_edit;
set_flags();
geometry = gNil;
start_game();
});
@ -1844,6 +1852,13 @@ EX namespace nisot {
shift_arg_formula(rots::underlying_scale);
return 0;
}
else if(argis("-nilperiod")) {
PHASEFROM(2);
if(nil) stop_game();
for(int a=0; a<3; a++) { shift(); nilv::nilperiod[a] = argi(); }
nilv::set_flags();
return 0;
}
return 1;
});