mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-09-07 21:16:48 +00:00
special fake implementation for 1,1 unrectified
This commit is contained in:
parent
4685c3e733
commit
e9f68dfb4d
13
fake.cpp
13
fake.cpp
@ -34,6 +34,7 @@ EX namespace fake {
|
||||
if(WDIM == 2 && standard_tiling() && GOLDBERG && S3 == 4 && ((gp::param.first+gp::param.second) % 2)) return true;
|
||||
if(WDIM == 2 && standard_tiling() && GOLDBERG && S3 == 3 && ((gp::param.first-gp::param.second) % 3)) return true;
|
||||
if(WDIM == 2 && standard_tiling() && GOLDBERG && S3 == 4 && gp::param.first == 1 && gp::param.second == 1) return true;
|
||||
if(WDIM == 2 && standard_tiling() && UNRECTIFIED && S3 == 4 && gp::param.first == 1 && gp::param.second == 1) return true;
|
||||
if(arcm::in() && PURE) return true;
|
||||
if(hat::in()) return true;
|
||||
if(WDIM == 2) return false;
|
||||
@ -99,6 +100,10 @@ EX namespace fake {
|
||||
return ddspin(c, cid) * spin(-M_PI / c->type) * lxpush0((c == c->master->c7 ? cgi.hexf : cgi.hexvdist) * 3 / cf);
|
||||
}
|
||||
|
||||
if(UNRECTIFIED && S3 == 4 && gp::param.first == 1 && gp::param.second == 1) {
|
||||
return spin(90._deg * cid + -M_PI / c->type) * lxpush0(cgi.hexvdist * 3 / cf);
|
||||
}
|
||||
|
||||
if(GOLDBERG) return underlying_map->get_corner(c, cid, cf);
|
||||
|
||||
if(embedded_plane) {
|
||||
@ -126,6 +131,10 @@ EX namespace fake {
|
||||
c->cmove(d);
|
||||
return ddspin(c, d) * lxpush(cgi.crossf) * iddspin(c->move(d), c->c.spin(d), M_PI);
|
||||
}
|
||||
if(UNRECTIFIED && S3 == 4 && gp::param.first == 1 && gp::param.second == 1) {
|
||||
c->cmove(d);
|
||||
return spin(90._deg * d) * lxpush(cgi.crossf) * spin(-90._deg * c->c.spin(d) + M_PI);
|
||||
}
|
||||
if(embedded_plane) {
|
||||
geom3::light_flip(true);
|
||||
transmatrix T = adj(c, d);
|
||||
@ -574,6 +583,8 @@ EX ld compute_euclidean() {
|
||||
if(WDIM == 2 && BITRUNCATED) return 9 / (4.5 - 3. / S7 - 6. / S6);
|
||||
if(WDIM == 2 && standard_tiling() && GOLDBERG && S3 == 4 && gp::param.first == 1 && gp::param.second == 1)
|
||||
return S7 / (0.375 * S7 - 0.5);
|
||||
if(WDIM == 2 && standard_tiling() && UNRECTIFIED && S3 == 4 && gp::param.first == 1 && gp::param.second == 1)
|
||||
return 4;
|
||||
|
||||
if(WDIM == 2) return 4 / (S7-2.) + 2;
|
||||
|
||||
@ -596,6 +607,8 @@ EX ld around_orig() {
|
||||
if(WDIM == 2 && BITRUNCATED)
|
||||
return 3;
|
||||
if(WDIM == 2 && standard_tiling() && GOLDBERG && S3 == 4 && gp::param.first == 1 && gp::param.second == 1) return 4;
|
||||
if(WDIM == 2 && standard_tiling() && UNRECTIFIED && S3 == 4 && gp::param.first == 1 && gp::param.second == 1)
|
||||
return S7;
|
||||
if(WDIM == 2)
|
||||
return S3;
|
||||
if(underlying == gRhombic3)
|
||||
|
@ -1158,7 +1158,7 @@ EX struct dqi_poly *draw_shapevec(cell *c, const shiftmatrix& V, const vector<hp
|
||||
else if(currentmap->strict_tree_rules()) return &queuepolyat(V, shv[shvid(c)], col, prio);
|
||||
|
||||
#if CAP_GP
|
||||
else if(GOLDBERG) {
|
||||
else if(GOLDBERG || (INVERSE && fake::in())) {
|
||||
int id = gp::get_plainshape_id(c);
|
||||
if(isize(shv) > id) return &queuepolyat(V, shv[id], col, prio);
|
||||
return NULL;
|
||||
|
12
geometry.cpp
12
geometry.cpp
@ -587,7 +587,7 @@ EX bool is_reg3_variation(eVariation var) {
|
||||
}
|
||||
|
||||
EX bool special_fake() {
|
||||
return fake::in() && (BITRUNCATED || (S3 == 4 && gp::param.first == 1 && gp::param.second == 1));
|
||||
return fake::in() && (BITRUNCATED || (GOLDBERG && S3 == 4 && gp::param.first == 1 && gp::param.second == 1) || (UNRECTIFIED && gp::param.first == 1 && gp::param.second == 1));
|
||||
}
|
||||
|
||||
void geometry_information::prepare_basics() {
|
||||
@ -615,6 +615,8 @@ void geometry_information::prepare_basics() {
|
||||
|
||||
dynamicval<eVariation> gv(variation, variation);
|
||||
bool inv = INVERSE;
|
||||
bool specfake = special_fake();
|
||||
bool unrect = UNRECTIFIED;
|
||||
if(INVERSE) {
|
||||
variation = gp::variation_for(gp::param);
|
||||
println(hlog, "bitruncated = ", BITRUNCATED);
|
||||
@ -700,11 +702,11 @@ 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(special_fake()) {
|
||||
if(specfake) {
|
||||
vector<pair<ld, ld>> vals;
|
||||
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);
|
||||
vals.emplace_back(S7, unrect ? 0 : BITRUNCATED ? fake::around / 3 : fake::around / 2);
|
||||
vals.emplace_back(s6, unrect ? fake::around : BITRUNCATED ? fake::around * 2 / 3 : fake::around / 2);
|
||||
ld edgelength = euclid ? 1 : arcm::compute_edgelength(vals);
|
||||
|
||||
// circumradius and inradius, for S7 and S6 shapes
|
||||
@ -714,7 +716,7 @@ void geometry_information::prepare_basics() {
|
||||
auto i6 = hdist0(mid(xpush0(c6), cspin(0, 1, TAU/s6) * xpush0(c6)));
|
||||
|
||||
// note: tessf remains undefined
|
||||
hcrossf = crossf = i7 + i6;
|
||||
hcrossf = crossf = unrect ? i6+i6 : i7 + i6;
|
||||
hexf = c7;
|
||||
hexhexdist = i6 + i6;
|
||||
hexvdist = c6;
|
||||
|
@ -1414,7 +1414,7 @@ EX namespace gp {
|
||||
|
||||
EX hrmap* new_inverse() { return new hrmap_inverse; }
|
||||
|
||||
hrmap_inverse* inv_map() { return (hrmap_inverse*)currentmap; }
|
||||
hrmap_inverse* inv_map() { if(fake::in()) return FPIU(inv_map()); return (hrmap_inverse*)currentmap; }
|
||||
|
||||
EX bool inverse_pseudohept(cell *c) {
|
||||
cell *c1 = inv_map()->mapping[c];
|
||||
|
Loading…
Reference in New Issue
Block a user