underlying space view is now available in product space

This commit is contained in:
Zeno Rogue 2019-10-28 17:26:59 +01:00
parent e6a1279544
commit 72b52e178f
3 changed files with 16 additions and 4 deletions

View File

@ -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."
)

View File

@ -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<eModel> pm(pmodel, flat_model());

View File

@ -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<int> pcc(corner_centering, cornermode ? 1 : 2);
dynamicval<bool> pf(playerfound, true);
dynamicval<cellwalker> m5(centerover, viewctr.at->c7);
dynamicval<transmatrix> m2(View, ypush(0) * qtm(h));
dynamicval<transmatrix> m2(View, inprod ? pView : ypush(0) * qtm(h));
dynamicval<transmatrix> m3(playerV, Id);
dynamicval<transmatrix> m4(actual_view_transform, Id);
dynamicval<eModel> pm(pmodel, mdDisk);