mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-07-28 21:32:49 +00:00
kite-and-dart working correctly in embedded_plane
This commit is contained in:
parent
5edb1dba04
commit
d61e498d4b
@ -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)) {
|
EX transmatrix ddspin_side(cell *c, int d, ld bonus IS(0)) {
|
||||||
if(kite::in()) {
|
if(kite::in()) {
|
||||||
|
if(embedded_plane) return spin(bonus);
|
||||||
hyperpoint h1 = get_corner_position(c, gmod(d, c->type), 3);
|
hyperpoint h1 = get_corner_position(c, gmod(d, c->type), 3);
|
||||||
hyperpoint h2 = get_corner_position(c, gmod(d+1, c->type) , 3);
|
hyperpoint h2 = get_corner_position(c, gmod(d+1, c->type) , 3);
|
||||||
hyperpoint hm = mid(h1, h2);
|
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)) {
|
EX transmatrix iddspin_side(cell *c, int d, ld bonus IS(0)) {
|
||||||
if(kite::in()) {
|
if(kite::in()) {
|
||||||
|
if(embedded_plane) return spin(bonus);
|
||||||
hyperpoint h1 = get_corner_position(c, gmod(d, c->type), 3);
|
hyperpoint h1 = get_corner_position(c, gmod(d, c->type), 3);
|
||||||
hyperpoint h2 = get_corner_position(c, gmod(d+1, c->type) , 3);
|
hyperpoint h2 = get_corner_position(c, gmod(d+1, c->type) , 3);
|
||||||
hyperpoint hm = mid(h1, h2);
|
hyperpoint hm = mid(h1, h2);
|
||||||
|
21
kite.cpp
21
kite.cpp
@ -19,7 +19,7 @@ enum pshape {pDart, pKite};
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
transmatrix meuscale(ld z) {
|
transmatrix meuscale(ld z) {
|
||||||
if(euclid) {
|
if(meuclid) {
|
||||||
transmatrix T = Id;
|
transmatrix T = Id;
|
||||||
T[0][0] = z;
|
T[0][0] = z;
|
||||||
T[1][1] = z;
|
T[1][1] = z;
|
||||||
@ -30,7 +30,7 @@ transmatrix meuscale(ld z) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
transmatrix mspin(ld alpha) {
|
transmatrix mspin(ld alpha) {
|
||||||
if(euclid)
|
if(meuclid)
|
||||||
return spin(alpha);
|
return spin(alpha);
|
||||||
else
|
else
|
||||||
return cspin(1, 2, alpha);
|
return cspin(1, 2, alpha);
|
||||||
@ -39,14 +39,14 @@ transmatrix mspin(ld alpha) {
|
|||||||
const ld euscale = 0.5;
|
const ld euscale = 0.5;
|
||||||
|
|
||||||
transmatrix meupush(ld x, ld y) {
|
transmatrix meupush(ld x, ld y) {
|
||||||
if(euclid)
|
if(meuclid)
|
||||||
return eupush(euscale * x, euscale * y);
|
return eupush(euscale * x, euscale * y);
|
||||||
else
|
else
|
||||||
return bt::parabolic3(x, y);
|
return bt::parabolic3(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
hyperpoint mhpxy(ld x, ld 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;
|
else return bt::parabolic3(x, y) * C0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +161,7 @@ struct hrmap_kite : hrmap {
|
|||||||
h->s = hstate(s);
|
h->s = hstate(s);
|
||||||
h->dm4 = h->distance = dist;
|
h->dm4 = h->distance = dist;
|
||||||
if(bt::in() || dist == 0)
|
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;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,7 +247,9 @@ struct hrmap_kite : hrmap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void make_graphrules() {
|
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);
|
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);
|
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, 9, pKite, 4, pKite1);
|
||||||
graphrule(pKite, 10, pDart, 4, pKite3);
|
graphrule(pKite, 10, pDart, 4, pKite3);
|
||||||
graphrule(pKite, 11, pDart, 5, ipKite1 * ipDart1 * pDart2 * pDart2 * pDart2);
|
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 {
|
transmatrix adj(cell *c, int dir) override {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user