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

embeddings:: fixed with center_z

This commit is contained in:
Zeno Rogue 2023-05-15 02:16:02 +02:00
parent c77a5cef22
commit f22abb7def

View File

@ -1216,11 +1216,13 @@ EX void swapmatrix_iview(transmatrix& ori, transmatrix& V) {
if(geom3::swap_direction == -1) {
auto& data = mdata[&V];
data.logical_coordinates = cgi.emb->intermediate_to_logical * cgi.emb->actual_to_intermediate(V*C0);
auto tl = cgi.emb->intermediate_to_actual_translation(cgi.emb->logical_to_intermediate * data.logical_coordinates);
auto itl = inverse(tl);
auto itl = inverse(tl * lzpush(cgi.emb->center_z()));
data.rotation = itl * V;
data.logical_coordinates[2] = ilerp(cgi.FLOOR, cgi.WALL, data.logical_coordinates[2]);
auto& lc = data.logical_coordinates;
data.logical_coordinates[2] = ilerp(cgi.FLOOR, cgi.WALL, lc[2]);
if(nisot::local_perspective_used) data.rotation = data.rotation * ori;
swapmatrix(V);