mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-20 23:50:27 +00:00
binary::3D:: more efficient tmatrix
This commit is contained in:
parent
c66a76e00f
commit
cf34b90373
@ -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);
|
|
||||||
case 8:
|
|
||||||
h->cmove(8);
|
|
||||||
return inverse(tmatrix(h->move(8), h->c.spin(8)));
|
|
||||||
}
|
}
|
||||||
printf("error: case not handled in binary tiling tmatrix\n");
|
|
||||||
breakhere();
|
const transmatrix& tmatrix(heptagon *h, int dir) {
|
||||||
return Id;
|
if(dir == 8)
|
||||||
|
return inverse_tmatrix[h->c.spin(8)];
|
||||||
|
else
|
||||||
|
return direct_tmatrix[dir];
|
||||||
}
|
}
|
||||||
|
|
||||||
#if DIM == 3
|
#if DIM == 3
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user