mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-08 23:20:12 +00:00
2d3d:: monster at's are now fixed to 2D in all geometries (including virtual rebasing)
This commit is contained in:
parent
d5dc3f2176
commit
6ba308cac5
21
shmup.cpp
21
shmup.cpp
@ -1028,18 +1028,27 @@ cell *monster::findbase(const transmatrix& T) {
|
|||||||
else return findbaseAround(T, base);
|
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) {
|
void monster::rebasePat(const transmatrix& new_pat) {
|
||||||
if(isVirtual) {
|
if(isVirtual) {
|
||||||
at = new_pat;
|
at = new_pat;
|
||||||
virtualRebase(this, true);
|
virtualRebase(this, true);
|
||||||
fixmatrix(at); pat = at;
|
fix_to_2(at);
|
||||||
|
pat = at;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(quotient) {
|
if(quotient) {
|
||||||
at = inverse(gmatrix[base]) * new_pat;
|
at = inverse(gmatrix[base]) * new_pat;
|
||||||
virtualRebase(this, true);
|
virtualRebase(this, true);
|
||||||
fixmatrix(at);
|
fix_to_2(at);
|
||||||
fixelliptic(at);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pat = new_pat;
|
pat = new_pat;
|
||||||
@ -1047,11 +1056,7 @@ void monster::rebasePat(const transmatrix& new_pat) {
|
|||||||
// if(c2 != base) printf("rebase %p -> %p\n", base, c2);
|
// if(c2 != base) printf("rebase %p -> %p\n", base, c2);
|
||||||
base = c2;
|
base = c2;
|
||||||
at = inverse(gmatrix[c2]) * pat;
|
at = inverse(gmatrix[c2]) * pat;
|
||||||
if(GDIM == 3 && WDIM == 2) {
|
fix_to_2(at);
|
||||||
for(int i=0; i<4; i++) at[i][2] = 0, at[2][i] = 0;
|
|
||||||
at[2][2] = 1;
|
|
||||||
}
|
|
||||||
fixmatrix(at);
|
|
||||||
fixelliptic(at);
|
fixelliptic(at);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user