sanity checked the matrices in swapmatrix

This commit is contained in:
Zeno Rogue committed 2019-09-12 22:43:02 +02:00
1 parent d9754ec57c
commit 152ca6aacf
2 files changed
+6 -1

No files matched your search

+3 -1
View File
@@ -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