diff --git a/geometry2.cpp b/geometry2.cpp index adb20ef3..e6d4e215 100644 --- a/geometry2.cpp +++ b/geometry2.cpp @@ -259,8 +259,11 @@ void virtualRebase_cell(cell*& base, T& at, const U& check) { T best_at = at; while(true) { cell *newbase = NULL; - forCellCM(c2, base) { - transmatrix V2 = calc_relative_matrix(base, c2, C0); + forCellIdCM(c2, i, base) { + transmatrix V2 = + nil ? nilv::adjmatrix(base->c.spin(i)) : + asonov::in() ? asonov::adjmatrix(base->c.spin(i)) : + calc_relative_matrix(base, c2, C0); T cand_at = V2 * at; horo_distance newz(check(cand_at)); if(newz < currz) { diff --git a/hypgraph.cpp b/hypgraph.cpp index 3f07f3a3..304d35b2 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -1490,7 +1490,10 @@ EX void optimizeview() { if(penrose && euclid && (i < 4 || i >= 8)) continue; int i1 = i * DUALMUL; heptagon *h2 = createStep(viewctr.at, i1); - transmatrix T = asonov::in() ? asonov::adjmatrix(i) : currentmap->relative_matrix(h2, viewctr.at); + transmatrix T = + asonov::in() ? asonov::adjmatrix(i) : + nil ? nilv::adjmatrix(i) : + currentmap->relative_matrix(h2, viewctr.at); #if MAXMDIM >= 4 if(euclid && WDIM == 3) T = euclid3::move_matrix(viewctr.at->c7, i); diff --git a/nonisotropic.cpp b/nonisotropic.cpp index bdb64486..6ef84cb9 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -783,6 +783,10 @@ EX namespace nilv { EX array nilperiod, nilperiod_edit; + EX transmatrix adjmatrix(int i) { + return nisot::translate(mvec_to_point(movevectors[i])); + } + struct hrmap_nil : hrmap { unordered_map at; unordered_map coords; @@ -817,10 +821,6 @@ EX namespace nilv { return child; } - transmatrix adjmatrix(int i) { - return nisot::translate(mvec_to_point(movevectors[i])); - } - virtual transmatrix relative_matrix(heptagon *h2, heptagon *h1) override { for(int a=0; amove(a)) return adjmatrix(a); return nisot::translate(mvec_to_point(coords[h1].inverse() * coords[h2])); diff --git a/raycaster.cpp b/raycaster.cpp index bdf7e2de..c9b3cf09 100644 --- a/raycaster.cpp +++ b/raycaster.cpp @@ -840,6 +840,7 @@ EX void cast() { vector ms; for(int j=0; jrelative_matrix(cwt.at, cwt.at->cmove(j), Hypc) : currentmap->relative_matrix(cwt.at->master, cwt.at->cmove(j)->master)); if(prod) ms.push_back(Id); if(prod) ms.push_back(Id); @@ -904,7 +905,7 @@ EX void cast() { connections[u][2] = (S7+.5) / 1024.; continue; } - transmatrix T = asonov::in() ? Id : (prod ? currentmap->relative_matrix(c, c1, C0) : currentmap->relative_matrix(c->master, c1->master)) * inverse(ms[i]); + transmatrix T = (asonov::in() || nil) ? Id : (prod ? currentmap->relative_matrix(c, c1, C0) : currentmap->relative_matrix(c->master, c1->master)) * inverse(ms[i]); for(int k=0; k<=isize(ms); k++) { if(k < isize(ms) && !eqmatrix(ms[k], T)) continue; if(k == isize(ms)) ms.push_back(T);