1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-28 11:00:34 +00:00

iso_inverse for nil

This commit is contained in:
Zeno Rogue 2020-09-16 17:35:16 +02:00
parent 9aae9112bc
commit b8abcf6c11

View File

@ -1001,6 +1001,13 @@ EX transmatrix iso_inverse(const transmatrix& T) {
return pseudo_ortho_inverse(T);
if(sphere)
return ortho_inverse(T);
if(nil) {
transmatrix U = Id;
U[2][LDIM] = T[0][LDIM] * T[1][LDIM] - T[2][LDIM];
U[1][LDIM] = -T[1][LDIM];
U[2][1] = U[0][LDIM] = -T[0][LDIM];
return U;
}
if(euclid && !(cgflags & qAFFINE)) {
transmatrix U = Id;
for(int i=0; i<MDIM-1; i++)