From 72b52e178fad3d6adf4aefc6a09cf1036d3accd6 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 28 Oct 2019 17:26:59 +0100 Subject: [PATCH] underlying space view is now available in product space --- geom-exp.cpp | 6 ++++-- hud.cpp | 2 +- nonisotropic.cpp | 12 +++++++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/geom-exp.cpp b/geom-exp.cpp index 98efc1e3..248da402 100644 --- a/geom-exp.cpp +++ b/geom-exp.cpp @@ -760,13 +760,15 @@ EX void showEuclideanMenu() { }); } - else if(geometry == gRotSpace) { + else if(hybri) { auto r = rots::underlying_scale; dialog::addSelItem(XLAT("view the underlying geometry"), r > 0 ? fts(r)+"x" : ONOFF(false), '4'); dialog::add_action([] { dialog::editNumber(rots::underlying_scale, 0, 1, 0.05, 0.25, XLAT("view the underlying geometry"), XLAT( - "The space you are currently in the space of rotations of the underlying hyperbolic or spherical geometry. " + rotspace ? "The space you are currently in the space of rotations of the underlying hyperbolic or spherical geometry. " + : "You are currently in a product space.") + + XLAT( "This option lets you see the underlying space. Lands and some walls (e.g. in the Graveyard) are based on " "the respective features in the underlying world, but details such as monsters or items are ignored." ) diff --git a/hud.cpp b/hud.cpp index 0a41f40b..ad778c64 100644 --- a/hud.cpp +++ b/hud.cpp @@ -378,7 +378,7 @@ EX void drawStats() { bool cornermode = (vid.xres > vid.yres * 85/100 && vid.yres > vid.xres * 85/100); - if(geometry == gRotSpace) rots::draw_underlying(!cornermode); + if(geometry == gRotSpace || geometry == gProduct) rots::draw_underlying(!cornermode); { dynamicval pm(pmodel, flat_model()); diff --git a/nonisotropic.cpp b/nonisotropic.cpp index 03a095e7..73c0ab87 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -1639,13 +1639,23 @@ EX namespace rots { auto g = std::move(gmatrix); auto g0 = std::move(gmatrix0); + + ld alpha = atan2(inverse(nisot::local_perspective) * point3(1, 0, 0)); + + bool inprod = prod; + transmatrix pView = View; + if(inprod) { + pView = spin(alpha) * View; + ld z = zlevel(tC0(View)); + for(int a=0; a<3; a++) pView[a] *= exp(-z); + } hybrid::in_underlying_map([&] { cgi.require_shapes(); dynamicval pcc(corner_centering, cornermode ? 1 : 2); dynamicval pf(playerfound, true); dynamicval m5(centerover, viewctr.at->c7); - dynamicval m2(View, ypush(0) * qtm(h)); + dynamicval m2(View, inprod ? pView : ypush(0) * qtm(h)); dynamicval m3(playerV, Id); dynamicval m4(actual_view_transform, Id); dynamicval pm(pmodel, mdDisk);