mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-28 19:10:35 +00:00
the rotation fix did not work in SL2
This commit is contained in:
parent
bc102b000d
commit
35a502ae9a
@ -877,6 +877,14 @@ EX void orthonormalize(transmatrix& T) {
|
||||
}
|
||||
}
|
||||
|
||||
/** fix a 3D rotation matrix */
|
||||
EX void fix_rotation(transmatrix& rot) {
|
||||
dynamicval<eGeometry> g(geometry, gSphere);
|
||||
fixmatrix(rot);
|
||||
for(int i=0; i<3; i++) rot[i][3] = rot[3][i] = 0;
|
||||
rot[3][3] = 1;
|
||||
}
|
||||
|
||||
/** determinant 2x2 */
|
||||
EX ld det2(const transmatrix& T) {
|
||||
return T[0][0] * T[1][1] - T[0][1] * T[1][0];
|
||||
|
@ -2791,7 +2791,7 @@ EX namespace nisot {
|
||||
transmatrix push = eupush( tC0(T) );
|
||||
transmatrix push_back = eupush(tC0(T), -1);
|
||||
transmatrix gtl = push_back * T;
|
||||
{ dynamicval<eGeometry> g(geometry, gSphere); hr::fixmatrix(gtl); }
|
||||
fix_rotation(gtl);
|
||||
T = push * gtl;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user