From c22aeedde9fd800823785afa41eaa2a40142a2c5 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 17 Jun 2024 23:10:09 +0200 Subject: [PATCH] fixed_yz now works in all geometries where it makes sense --- config.cpp | 2 +- hypgraph.cpp | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/config.cpp b/config.cpp index c805a1f6..25541394 100644 --- a/config.cpp +++ b/config.cpp @@ -3003,7 +3003,7 @@ EX void show3D() { }); } - if(mproduct || embedded_plane) + if(has_fixed_yz()) dialog::addBoolItem_action(XLAT("fixed Y/Z rotation"), vid.fixed_yz, 'Z'); if(WDIM == 2 && GDIM == 3) { diff --git a/hypgraph.cpp b/hypgraph.cpp index c7b9cc66..b69b2dce 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -2020,8 +2020,12 @@ void hrmap_standard::draw_at(cell *at, const shiftmatrix& where) { } } +EX bool has_fixed_yz() { + return (embedded_plane || mhybrid || nil || euclid || sol || nih || (cgflags & qSTRETCHABLE) || (hyperbolic && bt::in())); + } + EX bool keep_vertical() { - if((WDIM == 2 || gproduct) && GDIM == 3 && vid.fixed_yz) return !CAP_ORIENTATION; + if(vid.fixed_yz && has_fixed_yz()) return !CAP_ORIENTATION; if(downseek.qty) return true; return false; } @@ -2033,9 +2037,19 @@ EX hyperpoint vertical_vector() { if(gproduct) Rot = NLP * Rot; return Rot * lztangent(vid.wall_height); } - if(gproduct && vid.fixed_yz) { + if(mproduct && vid.fixed_yz) { return get_view_orientation() * lztangent(1); } + if(((cgflags & qSTRETCHABLE) || (mtwisted && sphere)) && vid.fixed_yz) { + return stretch::itranslate(View * C0) * View * lztangent(1); + } + if((nil || euclid || sol || nih) && vid.fixed_yz) { + return View * lztangent(1); + } + if(hyperbolic && bt::in() && vid.fixed_yz) { + hyperpoint h = inverse(View) * C0; + return View * parabolic13_at(deparabolic13(h)) * xtangent(1); + } if(ds.qty && gproduct) return get_view_orientation() * product::inverse_exp(ds.point); if(ds.qty)