1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-21 08:00:25 +00:00

binary::3D:: more efficient tmatrix

This commit is contained in:
? 2019-02-22 21:06:07 +01:00 committed by Zeno Rogue
parent c66a76e00f
commit cf34b90373
2 changed files with 23 additions and 25 deletions

View File

@ -203,31 +203,28 @@ namespace binary {
} }
#endif #endif
transmatrix tmatrix(heptagon *h, int dir) { transmatrix direct_tmatrix[8];
switch(dir) { transmatrix inverse_tmatrix[8];
case 0:
return xpush(-log(2)) * parabolic(-1, -1); void build_tmatrix() {
case 1: direct_tmatrix[0] = xpush(-log(2)) * parabolic3(-1, -1);
return xpush(-log(2)) * parabolic(1, -1); direct_tmatrix[1] = xpush(-log(2)) * parabolic3(1, -1);
case 2: direct_tmatrix[2] = xpush(-log(2)) * parabolic3(-1, 1);
return xpush(-log(2)) * parabolic(-1, 1); direct_tmatrix[3] = xpush(-log(2)) * parabolic3(1, 1);
case 3: direct_tmatrix[4] = parabolic3(-2, 0);
return xpush(-log(2)) * parabolic(1, 1); direct_tmatrix[5] = parabolic3(+2, 0);
case 4: direct_tmatrix[6] = parabolic3(0, -2);
return parabolic(-2, 0); direct_tmatrix[7] = parabolic3(0, +2);
case 5: for(int i=0; i<8; i++)
return parabolic(+2, 0); inverse_tmatrix[i] = inverse(direct_tmatrix[i]);
case 6: btrange_cosh = cosh(btrange);
return parabolic(0, -2); }
case 7:
return parabolic(0, +2); const transmatrix& tmatrix(heptagon *h, int dir) {
case 8: if(dir == 8)
h->cmove(8); return inverse_tmatrix[h->c.spin(8)];
return inverse(tmatrix(h->move(8), h->c.spin(8))); else
} return direct_tmatrix[dir];
printf("error: case not handled in binary tiling tmatrix\n");
breakhere();
return Id;
} }
#if DIM == 3 #if DIM == 3

View File

@ -175,6 +175,7 @@ void precalc() {
} }
#endif #endif
if(binarytiling) hexvdist = rhexf = 1, tessf = 1, scalefactor = 1, crossf = hcrossf7; if(binarytiling) hexvdist = rhexf = 1, tessf = 1, scalefactor = 1, crossf = hcrossf7;
if(binarytiling && DIM == 3) binary::build_tmatrix();
scalefactor = crossf / hcrossf7; scalefactor = crossf / hcrossf7;
orbsize = crossf; orbsize = crossf;