1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-26 17:06:59 +00:00

fake for GP(1,1) in S3==4

This commit is contained in:
Zeno Rogue 2024-06-21 18:34:37 +02:00
parent 4811cdd183
commit 5b55da3090
3 changed files with 16 additions and 6 deletions

View File

@ -92,6 +92,10 @@ EX namespace fake {
hyperpoint get_corner(cell *c, int cid, ld cf=3) override {
if(GOLDBERG && S3 == 4 && gp::param.first == 1 && gp::param.second == 1) {
return ddspin(c, cid) * spin(-M_PI / c->type) * lxpush0((c == c->master->c7 ? cgi.hexf : cgi.hexvdist) * 3 / cf);
}
if(embedded_plane) {
geom3::light_flip(true);
hyperpoint h = get_corner(c, cid, cf);
@ -113,6 +117,10 @@ EX namespace fake {
}
transmatrix adj(cell *c, int d) override {
if(GOLDBERG && S3 == 4 && gp::param.first == 1 && gp::param.second == 1) {
c->cmove(d);
return ddspin(c, d) * lxpush(cgi.crossf) * iddspin(c->move(d), c->c.spin(d), M_PI);
}
if(embedded_plane) {
geom3::light_flip(true);
transmatrix T = adj(c, d);

View File

@ -694,17 +694,18 @@ void geometry_information::prepare_basics() {
2 * hdist0(mid(xspinpush0(M_PI/S6, hexvdist), xspinpush0(-M_PI/S6, hexvdist)))
: hdist(xpush0(crossf), xspinpush0(TAU/S7, crossf));
if(fake::in() && BITRUNCATED) {
if(fake::in() && (BITRUNCATED || (S3 == 4 && gp::param.first == 1 && gp::param.second == 1))) {
vector<pair<ld, ld>> vals;
vals.emplace_back(S7, fake::around / 3);
vals.emplace_back(S3*2, fake::around * 2 / 3);
int s6 = BITRUNCATED ? S3*2 : S3;
vals.emplace_back(S7, BITRUNCATED ? fake::around / 3 : fake::around / 2);
vals.emplace_back(s6, BITRUNCATED ? fake::around * 2 / 3 : fake::around / 2);
ld edgelength = euclid ? 1 : arcm::compute_edgelength(vals);
// circumradius and inradius, for S7 and S6 shapes
auto c7 = asin_auto(sin_auto(edgelength/2) / sin(M_PI / S7));
auto c6 = asin_auto(sin_auto(edgelength/2) / sin(M_PI / S6));
auto i7 = hdist0(mid(xpush0(c7), cspin(0, 1, 2*M_PI/S7) * xpush0(c7)));
auto i6 = hdist0(mid(xpush0(c6), cspin(0, 1, 2*M_PI/S6) * xpush0(c6)));
auto c6 = asin_auto(sin_auto(edgelength/2) / sin(M_PI / s6));
auto i7 = hdist0(mid(xpush0(c7), cspin(0, 1, TAU/S7) * xpush0(c7)));
auto i6 = hdist0(mid(xpush0(c6), cspin(0, 1, TAU/s6) * xpush0(c6)));
// note: tessf and hcrossf remain undefined
crossf = i7 + i6;

View File

@ -733,6 +733,7 @@ EX namespace gp {
next = point3(x+y/2., -y * sqrt(3) / 2, 0);
ld scale = 1 / hypot_d(2, next);
if(!GOLDBERG) scale = 1;
if(fake::in() && x == 1 && y == 1) scale = 1;
cgi.crossf *= scale;
cgi.hexhexdist *= scale;
cgi.hexvdist *= scale;