mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-05-08 16:12:06 +00:00
backed-map:: we don't need extra arg for rebase
This commit is contained in:
+1
-2
@@ -1603,8 +1603,7 @@ struct hrmap_arbi : hrmap {
|
||||
|
||||
transmatrix T = p.second * adj(h, d);
|
||||
|
||||
transmatrix U;
|
||||
bm.rebase(alt, T, U);
|
||||
bm.rebase(alt, T);
|
||||
fixmatrix(T);
|
||||
|
||||
for(auto& p2: bm.what_at[alt]) if(id_of(p2.first) == co.sid) {
|
||||
|
||||
+5
-4
@@ -657,12 +657,11 @@ struct hrmap_archimedean : hrmap {
|
||||
|
||||
auto& p1 = bm.where[h];
|
||||
|
||||
heptagon *alt = p1.first; auto alt0 = alt;
|
||||
heptagon *alt = p1.first; // auto alt0 = alt;
|
||||
|
||||
transmatrix T = p1.second * spin(-t1.first) * lxpush(t1.second);
|
||||
transmatrix U = Id;
|
||||
|
||||
bm.rebase(alt, T, U);
|
||||
bm.rebase(alt, T);
|
||||
|
||||
if(debug_geometry) println(hlog, "look for: ", alt, " / ", kz(T * C0));
|
||||
|
||||
@@ -675,17 +674,19 @@ struct hrmap_archimedean : hrmap {
|
||||
if(debug_geometry) println(hlog, "compare: ", kz(T1 * lxpush0(1)), ":: ", kz(p2.second * lxpush0(1)));
|
||||
if(same_point_may_warn(T1 * lxpush0(1), p2.second * lxpush0(1))) {
|
||||
|
||||
#if 0
|
||||
// T1 = p2.second
|
||||
// T * spin(pi+t2.first) == p2.second
|
||||
// p1.second * spinm(-t1.first) * lxpush(t1.second) * spin(pi+t2.first) == p2.second
|
||||
|
||||
// bring p1 and p2 closer, to prevent floating point errors
|
||||
if(hyperbolic && false) {
|
||||
if(hyperbolic) {
|
||||
fixup_matrix(p1.second, U * p2.second * spin(-M_PI - t2.first) * lxpush(-t1.second) * spin(t1.first), 0.25);
|
||||
fixup_matrix(p2.second, T1, 0.25);
|
||||
for(auto& z: bm.what_at[alt0]) if(z.first == h) z.second = p1.second;
|
||||
bm.where[p2.first].second = p2.second;
|
||||
}
|
||||
#endif
|
||||
|
||||
while(skip_digons(hs, -1)) hs--;
|
||||
connectHeptagons(hi, hs);
|
||||
|
||||
+3
-6
@@ -15,7 +15,7 @@ struct backed_map {
|
||||
|
||||
void initialize(heptagon *origin);
|
||||
void assign(heptagon *actual, heptagon *backer, transmatrix T);
|
||||
void rebase(heptagon*& backer, transmatrix& T, transmatrix& U);
|
||||
void rebase(heptagon*& backer, transmatrix& T);
|
||||
void handle_precision_errors(heptagon *actual);
|
||||
|
||||
geometry_information *alt_cgip[2];
|
||||
@@ -69,16 +69,14 @@ void backed_map::assign(heptagon *actual, heptagon *backer, transmatrix T) {
|
||||
what_at[backer].emplace_back(actual, T);
|
||||
}
|
||||
|
||||
void backed_map::rebase(heptagon*& backer, transmatrix& T, transmatrix& U) {
|
||||
void backed_map::rebase(heptagon*& backer, transmatrix& T) {
|
||||
if(mhyperbolic) {
|
||||
dynamicval<int> uc(cgip->use_count, cgip->use_count+1);
|
||||
dynamicval<eGeometry> g(geometry, gNormal);
|
||||
dynamicval<eVariation> gv(variation, eVariation::pure);
|
||||
dynamicval<geometry_information*> gi(cgip, find_alt_cgip());
|
||||
dynamicval<hrmap*> cm(currentmap, current_altmap);
|
||||
U = T;
|
||||
current_altmap->virtualRebase(backer, T);
|
||||
U = U * iso_inverse(T);
|
||||
}
|
||||
if(euclid) {
|
||||
/* hash the rough coordinates as heptagon* alt */
|
||||
@@ -124,8 +122,7 @@ void backed_map::handle_precision_errors(heptagon *h) {
|
||||
auto p2 = p1;
|
||||
p2.second = T;
|
||||
|
||||
transmatrix T0 = Id;
|
||||
rebase(p2.first, p2.second, T0);
|
||||
rebase(p2.first, p2.second);
|
||||
|
||||
if(first) {
|
||||
if(where.count(h2)) {
|
||||
|
||||
Reference in New Issue
Block a user