mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 21:07:17 +00:00
sanity checked the matrices in swapmatrix
This commit is contained in:
parent
d9754ec57c
commit
152ca6aacf
@ -387,6 +387,7 @@ namespace geom3 {
|
||||
void switch_always3() {
|
||||
geom3::always3 = !geom3::always3;
|
||||
need_reset_geometry = true;
|
||||
swapmatrix(View);
|
||||
callhooks(hooks_swapdim);
|
||||
}
|
||||
|
||||
@ -422,6 +423,7 @@ namespace geom3 {
|
||||
geom3::camera = 0;
|
||||
if(pmodel == mdDisk) pmodel = mdPerspective;
|
||||
need_reset_geometry = true;
|
||||
swapmatrix(View);
|
||||
callhooks(hooks_swapdim);
|
||||
}
|
||||
else {
|
||||
@ -432,6 +434,7 @@ namespace geom3 {
|
||||
geom3::depth = 1;
|
||||
if(pmodel == mdPerspective) pmodel = mdDisk;
|
||||
need_reset_geometry = true;
|
||||
swapmatrix(View);
|
||||
callhooks(hooks_swapdim);
|
||||
}
|
||||
}
|
||||
|
@ -359,9 +359,11 @@ void swapmatrix(transmatrix& T) {
|
||||
for(int i=0; i<4; i++) swap(T[i][2], T[i][3]);
|
||||
for(int i=0; i<4; i++) swap(T[2][i], T[3][i]);
|
||||
if(DIM == 3) {
|
||||
for(int i=0; i<4; i++) T[i][0] = T[0][i] = 0;
|
||||
for(int i=0; i<4; i++) T[i][2] = T[2][i] = 0;
|
||||
T[2][2] = 1;
|
||||
}
|
||||
fixmatrix(T);
|
||||
for(int i=0; i<4; i++) for(int j=0; j<4; j++) if(isnan(T[i][j])) T = Id;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user