1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-17 18:54:48 +00:00

embeddings:: fixed rotation in swapmatrix_iview

This commit is contained in:
Zeno Rogue 2023-02-11 02:01:10 +01:00
parent ec4ceb5347
commit f820f356b1

View File

@ -1141,7 +1141,8 @@ EX void swapmatrix_iview(transmatrix& ori, transmatrix& V) {
if(nisot::local_perspective_used) data.rotation = data.rotation * ori;
swapmatrix(V);
data.rotation = data.rotation * cgi.emb->logical_scaled_to_intermediate;
data.rotation = cgi.emb->intermediate_to_logical_scaled * data.rotation;
data.saved = V;
}
if(geom3::swap_direction == 1) {
@ -1152,7 +1153,7 @@ EX void swapmatrix_iview(transmatrix& ori, transmatrix& V) {
V = cgi.emb->intermediate_to_actual_translation( cgi.emb->logical_to_intermediate * data.logical_coordinates );
ori = Id;
auto rot = data.rotation;
rot = rot * cgi.emb->intermediate_to_logical_scaled;
rot = cgi.emb->logical_scaled_to_intermediate * rot;
if(nisot::local_perspective_used) ori = ori * rot;
else V = V * rot;
}