rug:: fixed moving the rug in Crystal

This commit is contained in:
Zeno Rogue committed 2026-11-05 12:31:33 +01:00
1 parent 685005cef2
commit 35125c7878
4 files changed
+11 -3

No files matched your search

+1
View File
@@ -3554,6 +3554,7 @@ EX int config3 = addHook(hooks_configfile, 100, [] {
param_b(vid.fixed_facing, "fixed facing", 0);
param_f(vid.fixed_facing_dir, "fixed facing dir", 90);
param_b(vid.fixed_yz, "fixed YZ", true);
param_b(rug::rug_fixed_yz, "rug fixed YZ", false);
param_b(frustum_culling, "frustum_culling");
param_b(numerical_minefield, "numerical_minefield")
-> editable("toggle numerical display", 'n');
+1 -1
View File
@@ -572,7 +572,7 @@ EX void full_rotate_camera(int dir, ld val) {
else if(GDIM == 3 && rshiftclick)
shift_view(ctangent(dir, -val * camera_speed)), didsomething = true, playermoved = false; /* -val because shift reverses */
#if CAP_CRYSTAL && CAP_RUG
else if(rug::rug_control() && rug::in_crystal())
else if(rug::rug_control() && rug::in_crystal() && rug::crystal_rotation)
crystal::apply_rotation(cspin(dir, 2, val * camera_rot_speed));
#endif
else if(GDIM == 3) {
+1
View File
@@ -1164,6 +1164,7 @@ EX void flip_z() {
hyperpoint coord_to_flat(ldcoord co, int dim = 3) {
auto& cs = crystal_map()->cs;
hyperpoint res = Hypc;
res[3] = 1;
co = co - rug_center;
for(int a=0; a<cs.dim; a++)
for(int b=0; b<dim; b++)
+8 -2
View File
@@ -21,6 +21,8 @@ EX namespace rug {
EX bool mouse_control_rug = false;
EX bool crystal_rotation = false;
EX transmatrix rugView;
EX ld lwidth = 2;
@@ -1122,11 +1124,13 @@ EX GLuint alternate_texture;
EX bool rug_control() { return rug::rugged; }
EX bool rug_fixed_yz = false;
#if HDR
struct using_rugview {
using_rugview() { if(rug_control()) swap(View, rugView), swap(geometry, gwhere); }
~using_rugview() { if(rug_control()) swap(View, rugView), swap(geometry, gwhere); }
using_rugview() { if(rug_control()) swap(View, rugView), swap(geometry, gwhere), swap(vid.fixed_yz, rug_fixed_yz); }
~using_rugview() { if(rug_control()) swap(View, rugView), swap(geometry, gwhere), swap(vid.fixed_yz, rug_fixed_yz); }
};
#endif
@@ -1629,6 +1633,8 @@ EX void show_crystal_settings() {
surface::shape_option(surface::dsCrystal, 'u', false);
#endif
dialog::addBoolItem_action("high-dim crystal rotation", crystal_rotation, 'r');
if(rug::in_crystal()) {
dialog::addItem("next home orientation", 'h');
dialog::add_action(crystal::next_home_orientation);