1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-31 22:12:59 +00:00

fixed reset and auto centering

This commit is contained in:
Zeno Rogue
2022-12-17 17:37:26 +01:00
parent b2f9038cd4
commit 5f645f2f25
3 changed files with 41 additions and 34 deletions

View File

@@ -657,6 +657,16 @@ EX transmatrix spin(ld alpha) {
return cspin(0, 1, alpha);
}
EX transmatrix logical_to_actual() {
if(embedded_plane && geom3::euc_in_nil()) return cspin90(2, 1);
if(embedded_plane && geom3::hyp_in_solnih()) return cspin90(0, 1) * cspin90(1, 2);
return Id;
}
EX transmatrix unswap_spin(transmatrix T) {
return ortho_inverse(logical_to_actual()) * T * logical_to_actual();
}
/** rotate by 90 degrees in the XY plane */
EX transmatrix spin90() {
if(embedded_plane && geom3::euc_in_hyp() && !destandarize_eih) return cspin90(1, 2);