mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-04 02:32:51 +00:00
calc_relative_matrix for euwrap geometries now uses cellrelmatrix nicely
This commit is contained in:
parent
c993e80a18
commit
e5ebac156e
@ -83,27 +83,22 @@ transmatrix calc_relative_matrix(cell *c2, cell *c1, const hyperpoint& point_hin
|
|||||||
|
|
||||||
if(euwrap) {
|
if(euwrap) {
|
||||||
transmatrix t = Id;
|
transmatrix t = Id;
|
||||||
if(whateveri) printf("[%p,%d] ", c2, celldistance(c2, c1));
|
// if(whateveri) printf("[%p,%d] ", c2, celldistance(c2, c1));
|
||||||
int mirrors = 0;
|
|
||||||
approach:
|
|
||||||
int d = celldistance(c2, c1);
|
int d = celldistance(c2, c1);
|
||||||
forCellIdEx(c3, i, c2) {
|
while(d) {
|
||||||
if(celldistance(c3, c1) < d) {
|
forCellIdEx(cc, i, c1) {
|
||||||
if(whateveri) printf(" %d [%p,%d]", i, c3, celldistance(c3, c1));
|
int d1 = celldistance(cc, c2);
|
||||||
if(c2->type < 8)
|
if(d1 < d) {
|
||||||
t = eumovedir(i+(euclid6?3:2)) * t;
|
t = t * cellrelmatrix(c1, i);
|
||||||
else if(i&1)
|
c1 = cc;
|
||||||
t = eumovedir(2+i/2) * eumovedir(2+(i+1)/2) * t;
|
d = d1;
|
||||||
else
|
goto again;
|
||||||
t = eumovedir(2+i/2) * t;
|
|
||||||
if(c2->c.mirror(i)) mirrors++;
|
|
||||||
c2 = c3;
|
|
||||||
goto approach;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(d != 0) printf("ERROR not reached\n");
|
printf("ERROR not reached\n");
|
||||||
if(mirrors&1) t = Mirror * t * Mirror;
|
break;
|
||||||
if(whateveri) printf(" => %p\n", c1);
|
again: ;
|
||||||
|
}
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user