Rug option in 3D settings

This commit is contained in:
Zeno Rogue 2023-01-05 16:57:08 +01:00
parent 3052a9f29b
commit 28146b13f7
2 changed files with 15 additions and 1 deletions

View File

@ -2287,6 +2287,14 @@ EX void show_spatial_embedding() {
if(emb == geom3::seNone) {
dialog::addBoolItem(XLAT("third-person perspective"), in_tpp(), 'T');
dialog::add_action(geom3::switch_tpp);
dialog::addBoolItem(XLAT("Hypersian Rug"), rug::rugged, 'u');
dialog::add_action([] {
if(in_tpp()) geom3::switch_tpp();
if(!rug::rugged) {
pconf.alpha = 1, pconf.scale = 1; if(!rug::rugged) rug::init();
}
else rug::close();
});
dialog::addBreak(100);
}
else {
@ -2404,6 +2412,11 @@ EX void show3D() {
dialog::addSelItem(XLAT("projection"), current_proj_name(), 'M');
dialog::add_action_push(models::model_menu);
}
if(GDIM == 2) {
dialog::addItem(XLAT("configure Hypersian Rug"), 'u');
dialog::add_action_push(rug::show);
}
#if MAXMDIM >= 4
if(GDIM == 3) add_edit_fov('f');
if(GDIM == 3) {

View File

@ -1113,7 +1113,7 @@ EX namespace geom3 {
#endif
EX vector<pair<string, string>> spatial_embedding_options = {
{"2D engine", "Use HyperRogue's 2D engine to simulate same curvature. Works well in top-down and third-person perspective."},
{"2D engine", "Use HyperRogue's 2D engine to simulate same curvature. Works well in top-down and third-person perspective. The Hypersian Rug mode can be used to project this to a surface."},
{"same curvature", "Embed as an equidistant surface in the 3D version of the same geometry."},
{"lower curvature", "Embed as a surface in a space of lower curvature."},
{"much lower curvature", "Embed sphere as a sphere in hyperbolic space."},
@ -1299,6 +1299,7 @@ EX void switch_always3() {
EX void switch_tpp() {
if(dual::split(switch_fpp)) return;
if(rug::rugged) rug::close();
if(pmodel == mdDisk && pconf.camera_angle) {
vid.yshift = 0;
pconf.camera_angle = 0;