From ccf9abc2b6fa55cda387a68d9bf506eafe508798 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 19 May 2023 01:09:02 +0200 Subject: [PATCH] automatic reversal in swapmatrix when wallheight changes --- embeddings.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/embeddings.cpp b/embeddings.cpp index f8331860..7ab2e121 100644 --- a/embeddings.cpp +++ b/embeddings.cpp @@ -1207,6 +1207,7 @@ struct embedded_matrix_data { transmatrix saved; hyperpoint logical_coordinates; transmatrix rotation; + ld old_height; }; map mdata; @@ -1229,6 +1230,7 @@ EX void swapmatrix_iview(transmatrix& ori, transmatrix& V) { data.rotation = cgi.emb->intermediate_to_logical_scaled * data.rotation; data.saved = V; + data.old_height = vid.wall_height; } if(geom3::swap_direction == 1) { if(!mdata.count(&V)) { swapmatrix(V); ori = Id; return; } @@ -1242,6 +1244,7 @@ EX void swapmatrix_iview(transmatrix& ori, transmatrix& V) { rot = cgi.emb->logical_scaled_to_intermediate * rot; if(nisot::local_perspective_used) ori = ori * rot; else V = V * rot; + if(vid.wall_height * data.old_height < 0) V = MirrorY * V; } }