1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 17:10:36 +00:00

kite-and-dart working correctly in embedded_plane

This commit is contained in:
Zeno Rogue 2022-12-15 23:13:38 +01:00
parent 5edb1dba04
commit d61e498d4b
2 changed files with 17 additions and 6 deletions

View File

@ -468,6 +468,7 @@ EX ld cellgfxdist(cell *c, int d) { return currentmap->spacedist(c, d); }
EX transmatrix ddspin_side(cell *c, int d, ld bonus IS(0)) {
if(kite::in()) {
if(embedded_plane) return spin(bonus);
hyperpoint h1 = get_corner_position(c, gmod(d, c->type), 3);
hyperpoint h2 = get_corner_position(c, gmod(d+1, c->type) , 3);
hyperpoint hm = mid(h1, h2);
@ -478,6 +479,7 @@ EX transmatrix ddspin_side(cell *c, int d, ld bonus IS(0)) {
EX transmatrix iddspin_side(cell *c, int d, ld bonus IS(0)) {
if(kite::in()) {
if(embedded_plane) return spin(bonus);
hyperpoint h1 = get_corner_position(c, gmod(d, c->type), 3);
hyperpoint h2 = get_corner_position(c, gmod(d+1, c->type) , 3);
hyperpoint hm = mid(h1, h2);

View File

@ -19,7 +19,7 @@ enum pshape {pDart, pKite};
#endif
transmatrix meuscale(ld z) {
if(euclid) {
if(meuclid) {
transmatrix T = Id;
T[0][0] = z;
T[1][1] = z;
@ -30,7 +30,7 @@ transmatrix meuscale(ld z) {
}
transmatrix mspin(ld alpha) {
if(euclid)
if(meuclid)
return spin(alpha);
else
return cspin(1, 2, alpha);
@ -39,14 +39,14 @@ transmatrix mspin(ld alpha) {
const ld euscale = 0.5;
transmatrix meupush(ld x, ld y) {
if(euclid)
if(meuclid)
return eupush(euscale * x, euscale * y);
else
return bt::parabolic3(x, y);
}
hyperpoint mhpxy(ld x, ld y) {
if(euclid) return hpxy(euscale * x, euscale * y);
if(meuclid) return hpxy(euscale * x, euscale * y);
else return bt::parabolic3(x, y) * C0;
}
@ -161,7 +161,7 @@ struct hrmap_kite : hrmap {
h->s = hstate(s);
h->dm4 = h->distance = dist;
if(bt::in() || dist == 0)
h->c7 = newCell(euclid ? 4 : s == pKite ? 12 : 10, h);
h->c7 = newCell(meuclid ? 4 : s == pKite ? 12 : 10, h);
return h;
}
@ -247,7 +247,9 @@ struct hrmap_kite : hrmap {
}
void make_graphrules() {
if(geom3::flipped) return geom3::in_not_flipped([&] { return make_graphrules(); });
bool f = geom3::flipped;
bool emb = embedded_plane;
if(emb) geom3::light_flip(true);
pKite1 = meupush(-1, kite_center + 0) * mspin(108._deg) * meuscale(rphi) * meupush(0, down - kite_center);
pKite2 = meupush(1, kite_center + 0) * mspin(-108._deg) * meuscale(rphi) * meupush(0, down - kite_center);
@ -300,6 +302,13 @@ struct hrmap_kite : hrmap {
graphrule(pKite, 9, pKite, 4, pKite1);
graphrule(pKite, 10, pDart, 4, pKite3);
graphrule(pKite, 11, pDart, 5, ipKite1 * ipDart1 * pDart2 * pDart2 * pDart2);
if(emb) {
geom3::light_flip(false);
for(auto& g: graphrules) swapmatrix(g.second);
geom3::light_flip(f);
}
}
transmatrix adj(cell *c, int dir) override {