1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-18 03:09:59 +00:00

2d3d:: monster at's are now fixed to 2D in all geometries (including virtual rebasing)

This commit is contained in:
Zeno Rogue 2019-05-11 19:44:33 +02:00
parent d5dc3f2176
commit 6ba308cac5

View File

@ -1028,18 +1028,27 @@ cell *monster::findbase(const transmatrix& T) {
else return findbaseAround(T, base);
}
void fix_to_2(transmatrix& T) {
if(GDIM == 3 && WDIM == 2) {
for(int i=0; i<4; i++) T[i][2] = 0, T[2][i] = 0;
T[2][2] = 1;
}
fixmatrix(T);
fixelliptic(T);
}
void monster::rebasePat(const transmatrix& new_pat) {
if(isVirtual) {
at = new_pat;
virtualRebase(this, true);
fixmatrix(at); pat = at;
fix_to_2(at);
pat = at;
return;
}
if(quotient) {
at = inverse(gmatrix[base]) * new_pat;
virtualRebase(this, true);
fixmatrix(at);
fixelliptic(at);
fix_to_2(at);
return;
}
pat = new_pat;
@ -1047,11 +1056,7 @@ void monster::rebasePat(const transmatrix& new_pat) {
// if(c2 != base) printf("rebase %p -> %p\n", base, c2);
base = c2;
at = inverse(gmatrix[c2]) * pat;
if(GDIM == 3 && WDIM == 2) {
for(int i=0; i<4; i++) at[i][2] = 0, at[2][i] = 0;
at[2][2] = 1;
}
fixmatrix(at);
fix_to_2(at);
fixelliptic(at);
}