mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-09 23:50:08 +00:00
fixed shmup::fix_to_2
This commit is contained in:
parent
5f645f2f25
commit
436f782541
24
shmup.cpp
24
shmup.cpp
@ -183,11 +183,29 @@ cell *monster::findbase(const shiftmatrix& T, int maxsteps) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void fix_to_2(transmatrix& T) {
|
void fix_to_2(transmatrix& T) {
|
||||||
if(GDIM == 3 && WDIM == 2 && !gproduct) {
|
if(embedded_plane) {
|
||||||
|
if(geom3::sph_in_low()) {
|
||||||
|
for(int i=0; i<4; i++) T[i][3] = 0, T[3][i] = 0;
|
||||||
|
T[3][3] = 1;
|
||||||
|
fixmatrix(T);
|
||||||
|
}
|
||||||
|
else if(geom3::same_in_same()) {
|
||||||
for(int i=0; i<4; i++) T[i][2] = 0, T[2][i] = 0;
|
for(int i=0; i<4; i++) T[i][2] = 0, T[2][i] = 0;
|
||||||
T[2][2] = 1;
|
T[2][2] = 1;
|
||||||
|
fixmatrix(T);
|
||||||
}
|
}
|
||||||
if(nonisotropic) {
|
else if(gproduct) {
|
||||||
|
fixmatrix(T);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
hyperpoint h = tC0(T);
|
||||||
|
transmatrix rot = iso_inverse(map_relative_push(h)) * T;
|
||||||
|
fix_rotation(rot);
|
||||||
|
T = map_relative_push(h) * rot;
|
||||||
|
fixmatrix(T);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(nonisotropic) {
|
||||||
hyperpoint h = tC0(T);
|
hyperpoint h = tC0(T);
|
||||||
transmatrix rot = gpushxto0(h) * T;
|
transmatrix rot = gpushxto0(h) * T;
|
||||||
fix_rotation(rot);
|
fix_rotation(rot);
|
||||||
@ -228,11 +246,9 @@ void monster::rebasePat(const shiftmatrix& new_pat, cell *c2) {
|
|||||||
if(multi::players == 1 && this == shmup::pc[0])
|
if(multi::players == 1 && this == shmup::pc[0])
|
||||||
current_display->which_copy = current_display->which_copy * inverse_shift(gmatrix[base], gmatrix[c2]);
|
current_display->which_copy = current_display->which_copy * inverse_shift(gmatrix[base], gmatrix[c2]);
|
||||||
pat = new_pat;
|
pat = new_pat;
|
||||||
// if(c2 != base) printf("rebase %p -> %p\n", base, c2);
|
|
||||||
base = c2;
|
base = c2;
|
||||||
at = inverse_shift(gmatrix[c2], pat);
|
at = inverse_shift(gmatrix[c2], pat);
|
||||||
fix_to_2(at);
|
fix_to_2(at);
|
||||||
fixelliptic(at);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool trackroute(monster *m, shiftmatrix goal, double spd) {
|
bool trackroute(monster *m, shiftmatrix goal, double spd) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user