1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 13:07:16 +00:00
This commit is contained in:
iacore 2024-10-03 20:09:52 +00:00
parent 8d3173d1a4
commit 1dfe67de86
No known key found for this signature in database
GPG Key ID: ED0D424AE4406330

View File

@ -2281,25 +2281,30 @@ EX namespace rots {
M[0][0] = +xx - yy - zz + ww;
M[1][1] = -xx + yy - zz + ww;
M[2][2] = -xx - yy + zz + ww;
M[0][1] = -2 * (xy + zw);
M[1][0] = -2 * (xy - zw);
M[0][2] = 2 * (xz - yw);
M[2][0] = 2 * (xz + yw);
M[1][2] = -2 * (yz + xw);
M[2][1] = -2 * (yz - xw);
if(hyperbolic) {
swap(M[0][2], M[1][2]);
swap(M[2][0], M[2][1]);
M[1][2] *= -1;
M[2][0] *= -1;
M[2][2] = xx + yy + zz + ww;
return M;
}
M[0][1] = -2 * (xy + zw);
M[1][0] = -2 * (xy - zw);
M[0][2] = -2 * (yz + xw);
M[2][0] = 2 * (yz - xw);
M[1][2] = -2 * (xz - yw);
M[2][1] = 2 * (xz + yw);
} else {
M[2][2] = -xx - yy + zz + ww;
M[0][1] = -2 * (xy + zw);
M[1][0] = -2 * (xy - zw);
M[0][2] = 2 * (xz - yw);
M[2][0] = 2 * (xz + yw);
M[1][2] = -2 * (yz + xw);
M[2][1] = -2 * (yz - xw);
}
return M;