mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-07 01:03:00 +00:00
MAJOR CHANGE: replaced (transmatrix,band_shift) pair with shiftmatrix
This commit is contained in:
24
euclid.cpp
24
euclid.cpp
@@ -227,15 +227,13 @@ EX namespace euc {
|
||||
}
|
||||
|
||||
void draw() override {
|
||||
dq::visited_by_matrix.clear();
|
||||
dq::clear_all();
|
||||
dq::enqueue_by_matrix(centerover->master, cview() * master_relative(centerover, true));
|
||||
|
||||
while(!dq::drawqueue.empty()) {
|
||||
auto& p = dq::drawqueue.front();
|
||||
heptagon *h = get<0>(p);
|
||||
transmatrix V = get<1>(p);
|
||||
dynamicval<ld> b(band_shift, get<2>(p));
|
||||
bandfixer bf(V);
|
||||
heptagon *h = p.first;
|
||||
shiftmatrix V = p.second;
|
||||
dq::drawqueue.pop();
|
||||
|
||||
cell *c = h->c7;
|
||||
@@ -244,7 +242,7 @@ EX namespace euc {
|
||||
if(in_wallopt() && isWall3(c) && isize(dq::drawqueue) > 1000 && !hybrid::pmap) continue;
|
||||
|
||||
if(draw) for(int i=0; i<S7; i++)
|
||||
dq::enqueue_by_matrix(h->move(i), V * adj(h, i));
|
||||
dq::enqueue_by_matrix(h->move(i), optimized_shift(V * adj(h, i)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -816,13 +814,13 @@ EX namespace euc {
|
||||
|
||||
EX void show_fundamental() {
|
||||
initquickqueue();
|
||||
transmatrix M = ggmatrix(cwt.at);
|
||||
hyperpoint h0 = M*C0;
|
||||
shiftmatrix M = ggmatrix(cwt.at);
|
||||
shiftpoint h0 = M*C0;
|
||||
auto& T_edit = eu_edit.user_axes;
|
||||
hyperpoint ha = M*(eumove(T_edit[0]) * C0 - C0) / 2;
|
||||
hyperpoint hb = M*(eumove(T_edit[1]) * C0 - C0) / 2;
|
||||
hyperpoint ha = M.T*(eumove(T_edit[0]) * C0 - C0) / 2;
|
||||
hyperpoint hb = M.T*(eumove(T_edit[1]) * C0 - C0) / 2;
|
||||
if(WDIM == 3) {
|
||||
hyperpoint hc = M*(eumove(T_edit[2]) * C0 - C0) / 2;
|
||||
hyperpoint hc = M.T*(eumove(T_edit[2]) * C0 - C0) / 2;
|
||||
for(int d:{-1,1}) for(int e:{-1,1}) {
|
||||
queueline(h0+d*ha+e*hb-hc, h0+d*ha+e*hb+hc, 0xFFFFFFFF);
|
||||
queueline(h0+d*hb+e*hc-ha, h0+d*hb+e*hc+ha, 0xFFFFFFFF);
|
||||
@@ -1170,12 +1168,12 @@ EX coord to_coord(gp::loc p) { return coord(p.first, p.second, 0); }
|
||||
|
||||
EX gp::loc sdxy() { return to_loc(eu.user_axes[1]) * gp::univ_param(); }
|
||||
|
||||
EX pair<bool, string> coord_display(const transmatrix& V, cell *c) {
|
||||
EX pair<bool, string> coord_display(const shiftmatrix& V, cell *c) {
|
||||
if(c != c->master->c7) return {false, ""};
|
||||
hyperpoint hx = eumove(main_axes[0]) * C0;
|
||||
hyperpoint hy = eumove(main_axes[1]) * C0;
|
||||
hyperpoint hz = WDIM == 2 ? C0 : eumove(main_axes[2]) * C0;
|
||||
hyperpoint h = kz(inverse(build_matrix(hx, hy, hz, C03)) * inverse(ggmatrix(cwt.at->master->c7)) * V * C0);
|
||||
hyperpoint h = kz(inverse(build_matrix(hx, hy, hz, C03)) * inverse_shift(ggmatrix(cwt.at->master->c7), V) * C0);
|
||||
|
||||
if(WDIM == 3)
|
||||
return {true, fts(h[0]) + "," + fts(h[1]) + "," + fts(h[2]) };
|
||||
|
||||
Reference in New Issue
Block a user