ads-game:: duality modes for AdS

This commit is contained in:
Zeno Rogue 2022-10-15 14:23:53 +02:00
parent 9121eb7d72
commit 0ddc6c722f
3 changed files with 26 additions and 4 deletions

View File

@ -16,6 +16,18 @@ struct cell_to_draw {
bool operator < (const cell_to_draw& c2) const { return d > c2.d; }
};
void apply_duality(shiftmatrix& S) {
if(use_duality == 1) {
S.T = unshift(S);
S.shift = 0; // get_shift_cycles(S.shift);
S.T = Duality * S.T * Duality;
};
if(use_duality == 2) {
S = ads_matrix(Id, -90*degree) * S * ads_matrix(Id, +90*degree);
S.T = spin(90*degree) * S.T;
}
}
void draw_game_cell(const cell_to_draw& cd) {
bool hv = rotspace;
using cellptr = cell*;
@ -133,7 +145,9 @@ void draw_game_cell(const cell_to_draw& cd) {
curvepoint(h);
}
curvepoint_first();
queuecurve(current * V * rock.at * ads_matrix(Id, rock.pt_main.shift+z), rock.col, 0, PPR::LINE);
ads_matrix S = current * V * rock.at * ads_matrix(Id, rock.pt_main.shift+z);
apply_duality(S);
queuecurve(S, rock.col, 0, PPR::LINE);
}
}
@ -163,7 +177,11 @@ void draw_game_cell(const cell_to_draw& cd) {
curvepoint(h);
}
curvepoint_first();
queuecurve(current * V * rock.at, shipcolor, 0, PPR::LINE);
ads_matrix S = current * V * rock.at;
S = S * spin(-(rock.ang+90)*degree);
apply_duality(S);
S = S * spin(+(rock.ang+90)*degree);
queuecurve(S, shipcolor, 0, PPR::LINE);
continue;
}

View File

@ -133,5 +133,7 @@ void replay_animation();
void switch_underlying();
bool ads_draw_cell(cell *c, const shiftmatrix& V);
extern transmatrix Duality;
extern int use_duality;
}}

View File

@ -23,6 +23,8 @@ void switch_pause() {
bool hv_klein = false;
int use_duality = 2;
transmatrix Duality;
void switch_underlying() {
@ -69,8 +71,8 @@ void switch_underlying() {
nomap = false;
nonisotropic_weird_transforms = true;
NLP = Id;
/* Duality = Id;
for(int a=0; a<4; a++) for(int b=0; b<4; b++) Duality[a][b] = (a^2) == b; */
Duality = Id;
for(int a=0; a<4; a++) for(int b=0; b<4; b++) Duality[a][b] = (a^2) == b;
}
else if(hybri) {