mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-15 13:17:13 +00:00
whirl:: fix ggshmup and calc_relative_matrix (also seems to fix nonbitrunc in general)
This commit is contained in:
1
hyper.h
1
hyper.h
@@ -2714,6 +2714,7 @@ inline hyperpoint tC0(const transmatrix &T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
transmatrix actualV(const heptspin& hs, const transmatrix& V);
|
transmatrix actualV(const heptspin& hs, const transmatrix& V);
|
||||||
|
transmatrix applyspin(const heptspin& hs, const transmatrix& V);
|
||||||
transmatrix cview();
|
transmatrix cview();
|
||||||
|
|
||||||
extern string bitruncnames[2];
|
extern string bitruncnames[2];
|
||||||
|
|||||||
@@ -456,6 +456,10 @@ transmatrix actualV(const heptspin& hs, const transmatrix& V) {
|
|||||||
return (hs.spin || nonbitrunc) ? V * spin(hs.spin*2*M_PI/S7 + (nonbitrunc ? M_PI:0) + whirl::alpha) : V;
|
return (hs.spin || nonbitrunc) ? V * spin(hs.spin*2*M_PI/S7 + (nonbitrunc ? M_PI:0) + whirl::alpha) : V;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
transmatrix applyspin(const heptspin& hs, const transmatrix& V) {
|
||||||
|
return (hs.spin || nonbitrunc) ? V * spin(hs.spin*2*M_PI/S7) : V;
|
||||||
|
}
|
||||||
|
|
||||||
namespace whirl {
|
namespace whirl {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -3379,7 +3379,7 @@ transmatrix &ggmatrix(cell *c) {
|
|||||||
t = gmatrix[centerover.c] * eumove(cell_to_vec(c) - cellwalker_to_vec(centerover));
|
t = gmatrix[centerover.c] * eumove(cell_to_vec(c) - cellwalker_to_vec(centerover));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
t = actualV(viewctr, cview()) * calc_relative_matrix(c, viewctr.h);
|
t = applyspin(viewctr, cview()) * calc_relative_matrix(c, viewctr.h);
|
||||||
}
|
}
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@@ -3388,7 +3388,11 @@ transmatrix calc_relative_matrix_help(cell *c, heptagon *h1) {
|
|||||||
transmatrix gm = Id;
|
transmatrix gm = Id;
|
||||||
heptagon *h2 = c->master;
|
heptagon *h2 = c->master;
|
||||||
transmatrix where = Id;
|
transmatrix where = Id;
|
||||||
if(!nonbitrunc) for(int d=0; d<S7; d++) if(h2->c7->mov[d] == c)
|
if(whirl::whirl && c != c->master->c7) {
|
||||||
|
auto li = whirl::get_local_info(c);
|
||||||
|
where = whirl::Tf[li.last_dir][li.relative.first&31][li.relative.second&31][fix6(li.total_dir)];
|
||||||
|
}
|
||||||
|
else if(!nonbitrunc) for(int d=0; d<S7; d++) if(h2->c7->mov[d] == c)
|
||||||
where = hexmove[d];
|
where = hexmove[d];
|
||||||
// always add to last!
|
// always add to last!
|
||||||
while(h1 != h2) {
|
while(h1 != h2) {
|
||||||
|
|||||||
Reference in New Issue
Block a user